(RDMLX) Addressing Screen Elements

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
JoeHam
Posts: 14
Joined: Thu Jul 19, 2012 5:35 pm

(RDMLX) Addressing Screen Elements

Post by JoeHam »

Hi everybody,

how can I address single screen elements of a LongRange RDMLX fuction screen?
Background is:
We have to check user authority for every input / output field and for push buttons also. Depending on authority these elements shall be set to visible, enabled, disabled and so on.
When working with Lansa VL Forms we have something like this to select the components that are defined:

For Each(#CONTROL) In(#COM_OWNER.ComponentControls)
....
Endfor

Is there anything like this possible with LongRange functions or do I have to address the elements name by name?

Many thanks in advance,
Joerg
Mark_Dale
Posts: 61
Joined: Thu Apr 19, 2012 11:06 am

Re: (RDMLX) Addressing Screen Elements

Post by Mark_Dale »

You can't iterate through the fields on a form because on the server side that information is not retained.
What you could do is add the security information as you set up the fields, using a common routine.

e.g. instead of using:

#COM_OWNER.Set_TextBox Name(#EnteredText.Name) Value('') Layout_Col(1) Layout_Row(1) Maxlength(256) Placeholder('Type something in')

you use something like:

#Com_Owner.MySetTextBox Name(#EnteredText.Name) Value('') Layout_Col(1) Layout_Row(1) Maxlength(256) Placeholder('Type something in') User(*USER) Screen(#Com_Owner.Name)
or

#My_Component.MySetTextBox Name(#EnteredText.Name) Value('') Layout_Col(1) Layout_Row(1) Maxlength(256) Placeholder('Type something in') User(*USER) Screen(#Com_Owner.Name)

The mthroutine MySetTextBox checks the user's authority to that screen and field, and uses #Com_Owner.Set_TextBox to create the field, but also sets Disabled/Editable or even the type (Label or textbox) based on the user's authority to that field and screen. If the field should not appear at all, then MySetTextBox does not create a textbox.

If you have multiple screens that require authority checking, it would be worth creating a common #My_Component that all your formwviews could make use of.

Regards
Mark Dale
Post Reply