• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple buttons not working

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic