aspose file tools*
The moose likes JSF and the fly likes Multiple buttons not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Multiple buttons not working" Watch "Multiple buttons not working" New topic
Author

Multiple buttons not working

Joao Victor Ribeiro
Greenhorn

Joined: Jul 06, 2008
Posts: 3
Hi folks, i've got a trouble in here:

I have two buttons that are rendered one at a time, depending on a specific condition. Each button has a specific actionListener.



In the backing bean i have the following:



The problem is:
I've got only the first button working and calling the create method at the backing bean.
When I try to call the second button, it gets rendered fine, but the actionListener seens to not be called and the update method at the backing bean is not invoked.

Does anyone have any idea on what's happening?

Thanks in advance
[ August 14, 2008: Message edited by: Joao Victor Ribeiro ]
Jerwin Louise Uy
Ranch Hand

Joined: Oct 27, 2007
Posts: 75
Are you using AJAX to show the second button? It might not be rendering the actual HTML strings, therefore the name attribute of the second button will not be processed in the request parameter, thus no ActionEvent will be invoked in the Invoke Application phase.


Uy Jerwin Louise Vergara
Junior Developer / Research and Development at Incuventure Partners Corporation
email: jerwin.uy@incuventure.net
Joao Victor Ribeiro
Greenhorn

Joined: Jul 06, 2008
Posts: 3
Originally posted by Jerwin Louise Uy:
Are you using AJAX to show the second button? It might not be rendering the actual HTML strings, therefore the name attribute of the second button will not be processed in the request parameter, thus no ActionEvent will be invoked in the Invoke Application phase.


Ajax is not being used.
An another ActionListener does the change between the buttons.
A post occurs when the second button is clicked but the actionlistener is not called.

Any ideas?
[ August 15, 2008: Message edited by: Joao Victor Ribeiro ]
Flashsnake So
Greenhorn

Joined: Sep 16, 2008
Posts: 2
I am having the same problem too. Hopefully, someone can answer.
Flashsnake So
Greenhorn

Joined: Sep 16, 2008
Posts: 2
Finally, I found the workaround for this problem. So what you can do is to make your seconds control such as commandLink and commandButton with the following:

<commandLink immediate="true" actionListener=".." ...>

Then you will find out that the variable in the page does not get updated. So, you need to use ValueChangeListener for all variables. Hopefully, it works for you.

Hope it helps,

eso
 
wood burning stoves
 
subject: Multiple buttons not working