What is the easiest way to allow numbers only in a Edit Box
*New to Lansa
Numeric Only in Edit Box
Re: Numeric Only in Edit Box
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
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
-
dannyoorburg
- Posts: 177
- Joined: Mon Jan 04, 2016 9:50 am
- Location: Australia
Re: Numeric Only in Edit Box
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
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