Forum Discussion

Richard__Harlan's avatar
Richard__Harlan
Historic F5 Account
Dec 01, 2011

Issuse with noyes and optional

Working on a new iApp based on f5.ip_forwarding iApp added new question that if answer yes it needs to display string text box. Could not get it working, took it to it simplest level made a new copy of the template and more one change a broke it again.

 

 

Original code

 

noyes forward_all

 

optional ( forward_all == "NO" ) {

 

string addr default "0.0.0.0" required validator "IpAddress"

 

string mask default "0.0.0.0" required validator "IpAddress"

 

string port default "0" required validator "PortNumber" display "small"

 

}

 

 

Changed code

 

noyes forward_all

 

optional ( forward_all == "YES" ) {

 

string addr default "0.0.0.0" required validator "IpAddress"

 

string mask default "0.0.0.0" required validator "IpAddress"

 

string port default "0" required validator "PortNumber" display "small"

 

}

 

 

Once the code change the foward_all to yes none of the other question show up even if the option is changed. Now it get weirder if I change it back to NO it still does not work till I create a new Template. Has anyone see this and have a work around to get this working? Thanks
  • Brent_Blood_768's avatar
    Brent_Blood_768
    Historic F5 Account
    Hey Richard,

    Quick check: try changing the "YES" to "Yes" (and "NO" to "No") as the value of YES_ANSWER is "Yes" - and I'm pretty sure case matters for the expressions entered in optional elements.

    "noyes" is defined in an apl script library as the following:

    define choice noyes default "No" display "small" {"No", "Yes"} 

    Cheers,

    -Brent