简体   繁体   中英

How can I check more than two conditions inside oncomplete

I have 4 conditions to check, I want to check it inside oncomplete statement. I recognized that I can check only two using if else. If I use if -> else if -> else if -> else if to check 4 conditions in oncomplete. When I did that it can check only if and else if (again 2 conditions only) Is any way to check more than two conditions? That's my code. That code can check only if and 1st else if

<a4j:commandLink .....
action ....
oncomplete=" if (1st condtition ) ; else if (2nd condition) ; else if (3th condition ) ; else if (4th condition)"

Any ideas?

If u want to check for true

if(1st condition && 2nd condition && 3rd condition && 4th condition){}

or any one true

if(1st condition || 2nd condition || 3rd condition || 4th condition){}

I find out an answear for my own question. I will explain that in the answear of it. But i will explain my problem more properly for you and all guys who will read it anytime. So: I have a .xhtml file , where i am using Seam framework and JSF to connect front-end and back-end side of my project. Also i am using AJAX. I have the which is containing in body : onclick , action , oncomplete , rendered . So in oncomplete i wanted to check 4 different condtitions , depends of result i wanted to call an method from some java class. But oncomplete supports only if else. – svennnx3 3 mins ago Edit
And i wanted to use if else if , else if , else if. It not gonna work unfrotunately. So i only did 2 condtitions ( if and else). my methods just set 2 boolean variables. Then i am calling to show an dialog window when my booleans are true. That solves my problem, to show two dialogs at once or only 1 when only one variable is true :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM