Merrill
Consultant, Sima Solutions
Originally posted by Merrill Higginson:
bedek bedek,
I'm providing a response to your question below, but before you post again, there's something I'd like you to take care of. Since "bedek bedek" is an obviously fictitious name, it is in violation of our naming policy, which we take quite seriously. Please change the "publicly displayed name" in youruser profile so that it conforms to the JavaRanch naming policy.
My advice in this case is simply to change your Action so that it extends DispatchAction instead of LookupDispatchAction. Then change the property name of all your buttons to something other than method and make method a hidden field. Then for each of your buttons, use JavaScript to set the value of the method field before submitting. Example:
[ March 21, 2007: Message edited by: Merrill Higginson ]
Merrill
Consultant, Sima Solutions
Originally posted by Merrill Higginson:
There may be a way to make it work, and if you really want to continue using LookupDispatchAction, then go for it.
All I'm saying is that the only real reason to use LookupDispatchAction over DispatchAction is if you want to have the message bundle key used for the button labels act as the means of selecting which method to execute.
If for some reason you can't do that, to me it makes no sense at all to use LookupDispatchAction. All you're doing is making the process a lot more complicated. Using DispatchAction is much more straightforward in a situation where you're using JavasScript to set a value.
Merrill
Consultant, Sima Solutions
Originally posted by Merrill Higginson:
If you'll look closely at my first post, you will see that the suggested solution that I gave was dependent on changing the Action class so that it no longer extends LookupDispatchAction, but extends DispatchAction instead. You apparently haven't changed the inheritance of your Action class, and that's why you're getting the error.
As I mentioned before, I think using LookupDispatchAction in this case does not make sense. However, if you have some reason that I don't know about for continuing to use LookupDispatchAction, here's how you'd do it:
Create an entry in your message bundle:
If you have multiple properties files for different languages, you must put the same key with the same value in each of them. Do not translate "someValue" into the other languages, but leave it exactly as it is.
Then make sure "my.key" is in the key/method lookup table and code:
[ March 22, 2007: Message edited by: Merrill Higginson ]
Originally posted by Bednarski Adam:
Using this approach do I need to:
1) have "method" member in my form ?
2) put this member as <html:hidden... to my page ?
Merrill
Consultant, Sima Solutions
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|