Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple buttons not working

 
Joao Victor Ribeiro
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joao Victor Ribeiro
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having the same problem too. Hopefully, someone can answer.
 
Flashsnake So
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic