Editing Numeric Fields in a Table (RPG)
Posted: Wed Sep 26, 2012 1:36 am
If I have a single numeric input field on a screen, say order quantity, I can define it in the DDS as a numeric field with a length of 7 and zero decimal positions. I can use a DDS EDTCDE to format how the data is presented to the user, and I can set the DataType of the field to numeric so that the user is given the numeric keyboard for data entry. All is perfect. How can I do the same thing in a table?
Say I want the same order quantity field mentioned above as an input field in a table. If I define the table column as a textbox, I can SetProperty and use %EDITC to format the data for the correct presentation to the user, but since that makes the table element a CHARACTER field, the user gets the standard character keyboard and can enter invalid data into the field. If I set the table element DataType to Numeric or Integer, I cannot use the %EDITC to format the output for the user.
If I define the table column as a textbox with a DataType of Integer, the user receives the numeric keyboard for data entry, which is good, but the data in the table element is presented to the user with 6 decimal positions even though decimals are invalid in an Integer DataType. A quantity of 5 in this instance is displayed to the user as 5.000000. The user cannot manually enter a decimal into the field, but a decimal is displayed to the user. As far as I can tell, I have no way of editing the output presentation to the user to display the data as an Integer, while at the same time providing the numeric keyboard to the user for data entry.
What am I missing?
Say I want the same order quantity field mentioned above as an input field in a table. If I define the table column as a textbox, I can SetProperty and use %EDITC to format the data for the correct presentation to the user, but since that makes the table element a CHARACTER field, the user gets the standard character keyboard and can enter invalid data into the field. If I set the table element DataType to Numeric or Integer, I cannot use the %EDITC to format the output for the user.
If I define the table column as a textbox with a DataType of Integer, the user receives the numeric keyboard for data entry, which is good, but the data in the table element is presented to the user with 6 decimal positions even though decimals are invalid in an Integer DataType. A quantity of 5 in this instance is displayed to the user as 5.000000. The user cannot manually enter a decimal into the field, but a decimal is displayed to the user. As far as I can tell, I have no way of editing the output presentation to the user to display the data as an Integer, while at the same time providing the numeric keyboard to the user for data entry.
What am I missing?