Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do i capture HtmlCommandButton click

 
Rani Subramani
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing a custom component which renderes the HtmlCommandButton. I need to perform some logic on click of the button.
How do i capture whether the HtmlCommandButton is clicked or not using the button object in my java class

HtmlCommandButton button = (HtmlCommandButton) FacesContext
.getCurrentInstance().getApplication().createComponent(
HtmlCommandButton.COMPONENT_TYPE);



Thanks
Rani
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set the action expression.
 
Rani Subramani
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but setAction() method is deprecated...
 
Pari Gandhi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rani Subramani wrote:but setAction() method is deprecated...

Deprecation is always explained in the javadocs. Learn to find, read and understand the javadocs. Don't underestimate them.
http://java.sun.com/javaee/5/docs/api/javax/faces/component/UICommand.html#setAction(javax.faces.el.MethodBinding)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic