starki78 wrote the following on 7/25/2005 2:04 AM:
Hi, I've tested both types of actions but I really cannot say which action is better and I don't have the slightest feeling when which action to take.
Without trying to open up a whole other can of worms since there have been a bunch of recent threads concerning the dispatch/lookup concept, I would stay away from the LookupDispatchAction. There are other variants out there MappingDispatchAction, SimpleDispatchAction, and now SelectAction. Personally, I've just stuck with DispatchAction and like it. The other new flavors mentioned have some merit, but since you asked about LookupDispatchAction I'll reiterate again why I hate it...
1) Figuring out what method gets called when you press a button is way too annoying. You have to define a map in your Action class which represents the names of the buttons, but if you use your ApplicationResources file to have the names display on you page, you know have to do this translation to figure out what gets called... you need to look in the app resources file and then look in the map and find that key represented by the value in app resources and then you can see the method being called.
2) It makes it difficult for your button to do perform more than one type of action. For example, maybe you have a generic button used on a from that can be used for a couple different actions methods. If you call it "submit" it's only going to what 'submit' equates to in the Lookup map in your Action. If you use a Dispatch Action you can have your button do more than one type of action method since it's not keyed off the button name.
3) There are issues when you have more than one submit button on a page and the user presses enter on their keyboard. I forgot the exact problems but it was a real pain. In IE it acts one way, in other browsers a different way. I just remember cases where the button name being passed wasn't what was expected.
I wrote that above quickly, so it might not make sense, but save yourself some headaches and just use the DispatchAction (unless you want to look at some of the variants out there other than LookupDispatchAction... I was just lazy and dispatch works for me:)
-- Rick --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]