Bug #2188
fix runtime for SCREEN-VALUE attribute
Start date:
Due date:
% Done:
0%
Estimated time:
16.00 h
billable:
No
vendor_id:
GCD
case_num:
Related issues
History
#1 Updated by Constantin Asofiei over 10 years ago
- Estimated time set to 16.00
From #1612 note 27: SCREEN-VALUE
attribute doesn't seem to be fixed properly. See the GenericFrame.getScreenValue
changes -
public character getScreenValue(GenericWidget widget) { BaseDataType value; value = (BaseDataType) convertScreenValue(character.class, frameBuf.getScreenValue(widget.getId()), widget._getFormat()); if (value == null) value = (BaseDataType) getter(widget.getId(), ((ControlEntity) widget).getDataClass(), /* CHANGE: use widget's type */ true, false); // the getter is only guaranteed to return a character value when // the value is uninitialized, otherwise we get back whatever type // the data actually has if (!(value instanceof character)) { // convert it to character value = TextOps.trim(character.valueOf(value, widget.getFormat())); /* CHANGE: use widget's type */ } return (character) value; }
which are needed for this test to pass (note that the changes might be numeric-specific, might not work in other cases and might not be complete/correct):
def var d as dec label "Decimal" init 12345678.09 format ">>>,>>>,>>>.99". def var sdf as char. def var df as char init "12,345,678.09". form d with frame f1. display d with frame f1. sdf = trim(string(d, ">>>,>>>,>>>.99")). if (sdf <> df) then message "expected " df " and found " sdf. sdf = d:screen-value in frame f1. if (sdf <> df) then message "expected " df " and found screen-value " sdf.
The conclusion at this time is that SCREEN-VALUE must return what is actually in the frame's screen buffer for that widget, and not rely on type-specific values.
#2 Updated by Greg Shah about 8 years ago
- Target version changed from Milestone 12 to Milestone 16
#3 Updated by Greg Shah over 7 years ago
- Target version changed from Milestone 16 to Cleanup and Stabilization for GUI