Showing "special" values in number fields/smart fields [message #1400610] |
Mon, 14 July 2014 08:58  |
Eclipse User |
|
|
|
In our application we have forms that are used to display the values of single objects. For this, we have added IntegerFields, StringFields, LongFields, SmartFields and Checkboxes to the form.
However, the user also has the possibility to select multiple entries from a table and then display the same form for a consolidation of the values of all those entries. If a certain field has the same value for all entities, the corresponding field will display this value. If a field has differing values across those entries, an asterisk needs to be displayed in this field.
Obviously the case where an identical value needs to be shown is trivial (same as displaying values for a single entity). Covering the asterisk (*) case for a StringField is also trivial.
For the checkbox we wrote our own TriState checkbox control.
However, I don't quite see what the best way would be to display the asterisk for Integer/LongFields and for SmartFields.
For SmartFields I guess I could define a marker value that I could use with setValue() and then cover as a special case in the LookupCalls.getDataByKey() method.
How would this best be done for NumberFields? I could replace them with a StringField but as we also want to be able to enter data (overwriting the * to force a certain value on all instances of the field) this would mean I would need to add a lot of the validation functionality to this field that a NumberField already offers.
Is there a way to call IntegerField.setText() similar to the way execDecorateCell() works on table columns?
|
|
|
|
|
Re: Showing "special" values in number fields/smart fields [message #1401817 is a reply to message #1401238] |
Wed, 16 July 2014 01:50  |
Eclipse User |
|
|
|
Thank you Jérémie, in the mean time I've redesigned our solution a little. It no longer uses a "marker value" but adds a private member "asterisk" to AbstractAsteriskIntegerField which can then be set/cleared using the setter method. It also supports setValue(Integer value, boolean asterisk) so this can be achieved at the same time. We are then using a combination of execFormatValue() and setDisplayText().
|
|
|
Powered by
FUDForum. Page generated in 0.21359 seconds