Page 1 of 1

Numeric Only in Edit Box

Posted: Thu Nov 23, 2017 12:35 pm
by Chandima
What is the easiest way to allow numbers only in a Edit Box
*New to Lansa

Re: Numeric Only in Edit Box

Posted: Thu Nov 23, 2017 4:28 pm
by MarkDale
Probably the easiest way is to change the edit box data class to a numeric data dictionary field.

This is a lansa web example, where #STD_INT is a numeric field

Begin_Com Role(*EXTENDS #PRIM_WEB)
Define_Com Class(#PRIM_EDIT) Name(#Edit1) Displayposition(1) Left(118) Parent(#COM_OWNER) Showselection(False) Showselectionhilight(False) Tabposition(1) Top(89) Dataclass(#STD_INT) Value('0')
Define_Com Class(#STD_INT) Name(#STD_INT)
End_Com

Re: Numeric Only in Edit Box

Posted: Thu Nov 23, 2017 5:14 pm
by dannyoorburg
Back in the days, when I was new to LANSA, I clearly remember thinking about edit-boxes and how to move data in and out of the database and into the program and then in and out of the edit boxes on the screens.

I also remember being told to just use FIELDS and understand that LANSA was doing all the work for me :)

You can drag a FIELD onto a design, you read a FIELD from a table, and it will all magically work.

So I would say to get a numeric edit box, you probably want to create a numeric FIELD, drag that onto your design and use that instead.

Goodluck,
Danny