Absent Member.. Wang Dehong Absent Member..
Absent Member..
98 views

Is it possible to use a variable for read only condition / visible condition in a form?

I have to set ready only /visible condition for a field. If the express without varialbe, it's no problem. For example, [payment.amount.currency]="USD". If I change "USD" as a vairlabe: [payment.amount.currency]=$G.root.currency , it doesn't work.

 

Field payment.amount.currency can be changed in the form. Any suggestion for this? Thanks!

0 Likes
4 Replies
Highlighted
Absent Member.. Tong Yan Absent Member..
Absent Member..

Re: Is it possible to use a variable for read only condition / visible condition in a form?

Hi Dehong,

 

It should work. If it's not working, it might be a defect, or something wrong with setting value for the var $G.root.currency.

 

I suggest you to test using latest release and patch level, since many problems in this area have been fixed.

 

You can also try this workaround: Setting

 

Read only: False
ReadOnly Condition: [$readonly]=true

 

Then set $readonly from other places, like fc.

 

For detail please refer to:

KM41390 ServiceCenter: How to control the "read only" function of a field within a form, based on specific users
http://support.openview.hp.com/selfsolve/document/KM41390

 

Cheers 🙂
Yan Tong (Serene), HP Software Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution; and give kudo if you like it 🙂
0 Likes
Absent Member.. Wang Dehong Absent Member..
Absent Member..

Re: Is it possible to use a variable for read only condition / visible condition in a form?

Thanks for your reply!
I checked $G.root.currency's value in RAD dubugg, it's "USD". For your suggestion, if the field payment.amount.currency is not changed, it's OK. But user can change the field. Once the value changed, need to recalculate the variable [$readonly].
0 Likes
Acclaimed Contributor.. Vadim Gorda Acclaimed Contributor..
Acclaimed Contributor..

Re: Is it possible to use a variable for read only condition / visible condition in a form?

Hello,

can you please explain what is the goal? From your post i could not understand what you are trying to do.

 

You say that if you change currency on the form then read only condition is removed. But if you want to have it permanently on the field then just set it without any condition. If you have some value in the variable which is equal to your field on form at exact moment then field is read only, but if you change the value of the field it wont be equal to the variable meaning and read only will be removed. It is logical i think.

 

 

0 Likes
Absent Member.. Wang Dehong Absent Member..
Absent Member..

Re: Is it possible to use a variable for read only condition / visible condition in a form?

My goal is to use expression like [payment.amount.currency]=$G.root.currency in read only or visible condition. $G.root.currency is global variable.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.