On 7/22/05, Rick Reumann <[EMAIL PROTECTED]> wrote: > When you start adding alternative ways to have your disaptch method > called, it becomes more confusing to try and figure out what actually > gets called. This was a big beef I had with LookUpDispatchAction... it > was so annoying to figure what button did what.. it was complicated by > the fact that it's a good idea to use the ApplicationResources for the > names of your buttons. Yet, think how annoying it is to figure out what > happens... you have to look at the button, the app resources file, then > a map in the Action, and then finally you can figure out what method > gets called. I'm not saying these other solutions work this way (I know > they don't), but I'm just making the point that I find it nice to have > one consistent way of doing things that's easy for other developers to > follow.
This philosophy is one of the lessons we took to heart in designing JSF. In the particular case of buttons and hyperlinks, the label of the button and the binding to an action are separated and explicit: <h:commandButton id="save" value="#{messages['save.button.label']}" action="#{mybean.save_action}" .../> so you can grab button labels out of a resource bundle (or specify them literally if you don't care about l10n), and specify a call to the save_action() method specifically on each link so that you can immediately see the linkage (or share action methods if you have more than one button in your UI that should do the same thing). > > -- > Rick > Craig PS: Don't tell DJ, but JSF has transparently supported image buttons and the ".x/.y" thing from the very beginning :-) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]