Numeric Only in Edit Box

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Chandima
Posts: 2
Joined: Wed Sep 06, 2017 4:34 pm

Numeric Only in Edit Box

Post by Chandima »

What is the easiest way to allow numbers only in a Edit Box
*New to Lansa
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: Numeric Only in Edit Box

Post 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
dannyoorburg
Posts: 177
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: Numeric Only in Edit Box

Post 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
Post Reply