Hi,
I'm a LANSA Developer newbie, still need to learn a lot...
I have a requirement to show a field on the screen/page/form as a checkbox; the field itself can contain either ' ' (blank) or 'S'.
When it is 'S' we'd like the checkbox checked, and unchecked when it's ' '.
How to do this?
Thanks,
T.A.
How to show a field as checkbox
Re: How to show a field as checkbox
Open the Field in the Repository and click the Visualization tab. Here is the code I use.
I typically create an Alpha (1) field and use the below visualization.
Customize the N & Y to suite your needs.
I typically create an Alpha (1) field and use the below visualization.
Customize the N & Y to suite your needs.
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_OBJT)
Begin_Com Role(*Visual #PRIM_EVEF) Name(#VisualEdit) Componentversion(1) Height(19) Usepicklist(False) Width(178)
End_Com
* Picklist visualization Checkbox
Begin_Com Role(*Visual #PRIM_EVPL) Name(#CHECK) Appearance(CheckBox) Componentversion(1) Defaultvisual(True) Height(19) Width(209)
End_Com
Begin_Com Role(*picklist) Name(#Picklist) Nomatchaction(ShowValue)
Define_Com Class(#PRIM_PKIT) Name(#Item) Caption('N') Default(True) Parent(#Picklist) Value('N')
Define_Com Class(#PRIM_PKIT) Name(#Item_1) Caption('Y') Parent(#Picklist) Value('Y')
End_Com
End_Com
-
alphabeta13
- Posts: 21
- Joined: Tue Jan 14, 2020 12:18 am
Re: How to show a field as checkbox
Thanks Lawingo for your help, however I am still having problem, perhaps because I did not explain my question properly and also because of my very limited LANSA knowledge.
The field I was referring to was a field from an IBM i table. I cannot find option to define it as a checkbox.
When I tried to copy your code, I got lots of error messages. I am still trying to figure them out.
Regards,
T.A.
The field I was referring to was a field from an IBM i table. I cannot find option to define it as a checkbox.
When I tried to copy your code, I got lots of error messages. I am still trying to figure them out.
Regards,
T.A.
-
davidbalansa
- Posts: 92
- Joined: Mon Feb 01, 2016 10:08 am
Re: How to show a field as checkbox
I found this is the documentation searching for field visualizations:
https://docs.lansa.com/14/en/lansa013/c ... ef94685465
https://docs.lansa.com/14/en/lansa013/c ... ef94685465
Re: How to show a field as checkbox
The code lawingo sent was for a field visualisation. Did you open the field in the editor?alphabeta13 wrote: Wed Jan 15, 2020 1:55 am Thanks Lawingo for your help, however I am still having problem, perhaps because I did not explain my question properly and also because of my very limited LANSA knowledge.
The field I was referring to was a field from an IBM i table. I cannot find option to define it as a checkbox.
When I tried to copy your code, I got lots of error messages. I am still trying to figure them out.
Regards,
T.A.
Art Tostaine
-
alphabeta13
- Posts: 21
- Joined: Tue Jan 14, 2020 12:18 am
Re: How to show a field as checkbox
Thank you all for your kind help.
I got it now.
Regards,
T.A.
I got it now.
Regards,
T.A.