File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do i capture HtmlCommandButton click

 
Rani Subramani
Greenhorn
Posts: 7
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set the action expression.
 
Rani Subramani
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but setAction() method is deprecated...
 
Pari Gandhi
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • 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)
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic