Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inheriting from HtmlCommandButton

 
Garann Means
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If anyone can provide any guidance here, it would be very much appreciated.

I want a component than inherits from the JSF RI component HtmlCommandButton. My question is, what methods and attributes does my child component need to contain? I assume I don't need to deal with action, actionListener, and immediate, as these are dealt with by the HtmlCommandButton. I'm also leaving out the queueEvent and broadcast methods. The only things my child component contains are the additional attributes it defines, a constructor, getFamily(), and methods to save and restore the state of only the attributes defined by the child. Is that safe? Is that right?

Also, I have a bonus question. How, if at all, is what I'd need to do here different than what I'd do if my component inherited from UICommand? Or if my component implements ActionSource?

Thanks in advance for any feedback,
g.
[ August 16, 2005: Message edited by: Garann Rose Means ]
 
Garann Means
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about if I narrow the question down to whether the broadcast and queueEvent methods need to be re-implemented in every child of a class the implements ActionSource? Anyone?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar Question

I'm very curious about what kind of requirement that would be best solved by extending HtmlCommandButton. Would you mind sharing why it is needed?
 
Garann Means
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. I want to add a few convenience things, like the ability to have the result open in a new window, whether it should throw up a prompt before submitting, stuff like that. For most components (menus, tabs, imagemaps), I'm just extending UICommand, but I want to enhance the RI button a little, too.

Thanks for the link, though. The link at the bottom of that thread is definitely very helpful, as far as classes that implement ActionSource (of which I have several). You don't know of a similar article on extending HtmlCommandButton or HtmlCommandLink, do you?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic