Highlighted
Absent Member.
Absent Member.
305 views

How to use ternary operator in the condition of any Display Option?

Hi Experts,

 

I would like to know the proper syntax of the ternary operator which can be used in the condition of the Display Option.

I would also like to know whether we can use ternary operator in the condition or not?

 

Kindly help me with this.

 

Thank you in advance.

 

Regards,

Anjali 

0 Likes
5 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: How to use ternary operator in the condition of any Display Option?

Can you be more specific on what you're trying to accomplish?

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to use ternary operator in the condition of any Display Option?

By ternary operator did you mean the C/C++:  condition ? true-value : false-value

 

 

0 Likes
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: How to use ternary operator in the condition of any Display Option?

Hi,

You  can't.

Cause assignment value via RAD are not supported in condition expressions . 

You can do follow. 

Create SL and call via RAD function jscall.

you code should look like bellow 

function test(operator){
var value = (operator=="falcon") ? true : false;
return value;
}

after u can call JS functions via RAD function jscall in do condition like bellow

jscall("aa.test", operator())

HTH.

 

 

  

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to use ternary operator in the condition of any Display Option?

Hi Dennis,

 

Yes I mean the same ternary operator which we use in C/C++.

 

Regards,

Anjali

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to use ternary operator in the condition of any Display Option?

Hi Jacob,

 

I have to make one of the buttons display on the form when the Category is " WebPress Normal Change" . I even need to check if all the mandatory fields are filled or not in order to display the button. 

Now the problem is, there are four fields on the form which are mandatory when the subcategory is "Hardware" and rest all of the fields are mandatory all the time.

I wanted to do so using ternary operator in the condition of the diaplay option but it is not working.

Could you please help me.

 

Thank you.

 

Regards,
Anjali 

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.