Editing Numeric Fields in a Table (RPG)

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
rgjohnson
Posts: 19
Joined: Wed May 09, 2012 11:55 pm

Editing Numeric Fields in a Table (RPG)

Post by rgjohnson »

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?
JimKeating
Posts: 12
Joined: Thu Apr 19, 2012 11:45 pm

Re: Editing Numeric Fields in a Table (RPG)

Post by JimKeating »

You can use the LRNG_SetProperty API rather than LRNG_AssignNumToProp and specify the exact value you want displayed. So to use your example of the value 5, you can do LRNG_SetProperty('YOURNBR.Value' : '5'); This along with the DataType : Integer in the DDS will give you the numeric keyboard and display the value in the textbox without all the zeros to the right of the decimal point. This should be closer to what you are trying to achieve.
Post Reply