if else statement in beanshell

Confluence User - 21 Mar, 2016

is it possible to do a if-else statement in bean shell validator?

 

example in a selectbox i will put a if-else statement so there will be conditions where if a selectbox is  = "AFF" the values of the other select box will change.

forms;datalists;server;user

3


21 Mar, 2016
confluenceUser
confluenceUser

It is possible to put if-else in bean shell as it is just using Java syntax. u can refer to Bean Shell Programming Guide.

But, bean shell validator is used to validate the value of input element. i don't think it can achieve what u want. u may refer to Dynamic Cascading Drop-Down List will should be to do what u want to do.

21 Mar, 2016
confluenceUser
confluenceUser

hi! in my case, where will i use my bean shell syntax? if 2 select box will be involved, one is the business unit select box, where the items are"AFF, OFF". and the other select box will depend on the value of the first select box.

22 Mar, 2016
confluenceUser
confluenceUser

Hi,

If you would like to validating 2 fields' value, you can refer to Bean Shell Programming Guide:Use as Form Validator. It is an example of how you can retrieve another field's value and compare it with the value of the configured field (The field with the Bean Shell Validator).

Hope it helps.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print