views:

979

answers:

1

Hi All... I'm facing a problem with Icefaces ActionListener.... I need to prevent the actionListener to be fired while i still in client... In another way : I need to check a boolean expresion in javascript before the actionListener is fired, if my boolean expresion return false i want not to fire the actionListener, and if the result is true i want the actionListener to be fired.... is there any way to do that... please help me.....................

A: 

If you are using icefaces it is most likely better to not try doing this on the client side means in javascript. Is the action you are listening for a button click? If it is a button click send the Boolean expression along with the form data and use a validator. If the validator doesn't accept the data the actionmethod should not be called.

Janusz
Thank you for your replay, but the button i clicked not to submit data, it's to open a new window or navigate from page to page...I found the solution to this problem : which is : onclick = "return myConditionTest();" for the ice:commandButton.. and myConditionTest function return true or false.But the problem not only with button the real problem is with panelTabSet and onclick event : i need not to switch to the new tab if my onclick javascript function return false. but it switch to the new tab if the return value = true or = false.SO what to do in this case....
Saeed