Page 1 of 1

VLWeb Material Design Numeric field remove leading zero

Posted: Thu May 24, 2018 4:07 am
by jyoung
I feel like I've had to deal with this before with the traditional controls but can't recall or find it. Now I am having this issue with the Material Design controls.

When displaying a numeric field, here the Office Number, a 0 (zero) is the default because the "Default Value" of the field is *ZERO
capture1.PNG
capture1.PNG (7.85 KiB) Viewed 6605 times
My issue is when I put the cursor into the field, the 0 is there creating a leading zero. That's fine for mathematical ops, but for identifiers not so much, as leading zeros can be significant.
capture2.PNG
capture2.PNG (7.15 KiB) Viewed 6605 times
I need it to select the entire field so that when the user starts typing, the field contains ONLY what the user has entered, i.e. no leading zero.
capture3.PNG
capture3.PNG (7.29 KiB) Viewed 6605 times
Double clicking will select the whole field, but my user's should have to do that.

Do I have to programmaticly select the whole field when they click it? I feel like there should be an attribute or property to control that.

Re: VLWeb Material Design Numeric field remove leading zero

Posted: Thu May 24, 2018 6:10 am
by atostaine
Do you have an edit code on the field? You would want a Z

Back in the 5250 days, some users just couldn't handle field exit (which would right justify the field, like a calculator almost). Sometimes we would just use a work field to accept characters and then edit it to what we needed.

In lansa of course very easy.

if #workfield.isNumber
#number := #workfield.asNumber
endIf

Re: VLWeb Material Design Numeric field remove leading zero

Posted: Thu May 24, 2018 6:15 am
by jyoung
I knew it had to be something like that.

Thanks Art!

Re: VLWeb Material Design Numeric field remove leading zero

Posted: Thu May 24, 2018 6:16 am
by atostaine
Edit codes may be 40 years old, but they are pretty cool. :D

Re: VLWeb Material Design Numeric field remove leading zero

Posted: Thu May 24, 2018 6:29 am
by jyoung
I think LANSA calls them an "Edit Mask" setting it to 'Z' in the repo does the trick.
edit_mask.PNG
edit_mask.PNG (15.02 KiB) Viewed 6591 times