Details
-
New Feature
-
Resolution: Fixed
-
Minor
-
None
-
None
-
None
-
All
-
GreenHopper Ranking:0|i0wvvv:
-
9223372036854775807
-
Small
Description
The ComponentProperties contains a method called "refreshLayout".
This method allow us to set is a property is visible or not.
The API provide only a method to "hide" field, but no method to set them visible.
This add an unnecessary complexity on the definition of the visibility of the element and could be solve with few method on the class Form and Widget.
I propose to add:
- a "setVisible" method;
- imply the boolean when the developer do not specify it;
- add the possibility for the Form to retrieve a Widget directly from a Property.
Currently the code looks like:
if (useOtherConnection) { form.getWidget(useDataSource.getName()).setHidden(true); form.getWidget(dataSource.getName()).setHidden(true); } else { form.getWidget(useDataSource.getName()).setHidden(false); form.getWidget(dataSource.getName()).setHidden(!useDataSource.getValue()); }
My proposal would allow the user to do:
if (useOtherConnection) { form.getWidget(useDataSource).setHidden(); form.getWidget(dataSource).setHidden(); } else { form.getWidget(useDataSource).setVisible(); form.getWidget(dataSource).setVisible(useDataSource); }