File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Inheriting from HtmlCommandButton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Inheriting from HtmlCommandButton" Watch "Inheriting from HtmlCommandButton" New topic

Inheriting from HtmlCommandButton

Garann Means
Ranch Hand

Joined: Jan 28, 2002
Posts: 214
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,
[ August 16, 2005: Message edited by: Garann Rose Means ]
Garann Means
Ranch Hand

Joined: Jan 28, 2002
Posts: 214
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

Joined: Feb 05, 2003
Posts: 4727

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?

A good workman is known by his tools.
Garann Means
Ranch Hand

Joined: Jan 28, 2002
Posts: 214
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?
I agree. Here's the link:
subject: Inheriting from HtmlCommandButton
It's not a secret anymore!