Project

General

Profile

Bug #6016

Updated by Greg Shah over 4 years ago

Setting @SCREEN-VALUE@ for a selection list was improved by Adrian as part of #5992, however validation of input value as well as the actual update of the screen-value is not exactly as in 4GL:

* screen-value can be a list (using the list's delimiter), both for single/multi
* validation should validate all entries in the screen-value and fail if any entry not valid, it doesn't matter if single/multi
* when setting a 'single value' only the first item in the list that match must be selected (aka: if list had 's' and 'S' as items only first must be selected - case insensitive)
* when setting a 'multi value' for single selection list the last entry 'win', for multiple selection one item is selected for each entry - previous selection is not clear (append).

Because of the last item in the previous list the value set on @SelectionListWidget@ - although valid - could be different from the actual @screen-value@ of the selection-list. For single select list it will actually be just the last entry in the list, this can be handled in @SelectionListWidget@. For multi selection list is not that easy since the resulting screen-value could have previously selected items and even the ordering could be different - setting '3,2' as screen-value could result in '2,3' depending on the items order in the list.

Since everything seems to go through the @ScreenBuffer@ synchronisation I would need a way to make the 'server' side (where @SelectionListWidget@ lives) aware of the fact that the @screen-value@ is actually different of what is was sent. This is on the 'client' side in @SelectionList@ implementation and I don't seem to find the way to send it back :(

@LogicalTerminal.refreshFrameWidgets@ doesn't return anything so @GenericFrame.setScreenValue@ have no way of knowing if the value sent is different from what is actually set so it puts the initial value in the frame's screen buffer :(

I can tweak the @ThinClient.refreshFrameWidgets@ to also return the new widget value if there is only one widget in the list (@asFrameField@ is false) but that will also require returning that value from @ThinClient.refreshFrameWidgets@ and then use it in @GenericFrame@.

If there is another, easier, way please let me know.

Back