struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Jouravlev" <jmi...@gmail.com>
Subject Re: Multiple buttons with Dispatch Action
Date Wed, 15 Mar 2006 09:32:58 GMT
On 3/15/06, Ahmed Hashim <eng.hashim@gmail.com> wrote:
> I'd like to ask about the LookupDispatchAction
> If my action extends from LookupDispatchAction, can I use the execute method
> In case the user request the Action Directly? not from clicking a button?

execute() is always called first.

> I want the action to do the following:
> 1- Load the page
> 2- When the user click on button X it will execute function X
> 3- When the user click on the button Y it will execute function Y
> 4- When the user click on the button Z it will execute function Z
>
> I have another problem, the button Y,Z have the same value "add" how can I
> distinguish between them?
>
> Thanks for your help.
>
> On 2/17/06, Michael Jouravlev <jmikus@gmail.com> wrote:
> >
> > Use this one: http://issues.apache.org/bugzilla/attachment.cgi?id=17485
> > The related ticket:
> > http://issues.apache.org/bugzilla/show_bug.cgi?id=38343
> >
> > This class is better, simpler and leaner than LookupDispatchAction.
> >
> > Michael.
> >
> > On 2/16/06, Sun Shine <spyder0807@yahoo.com> wrote:
> > > Hi,
> > > I have a page with multiple 'links'. One is an image
> > > button and another is a simple submit button.
> > >
> > > I was using a Dispatch action that maps to each one of
> > > these buttons, using javascript to set the
> > > methodToCall on each of the buttons. worked like a
> > > charm until...
> > >
> > > I was informed I cannot use javascript for page
> > > direction(in case users browser is javascript
> > > disabled.).
> > >
> > > So, the only way I could think of is to wrap the img
> > > and submit button around an href and link to my
> > > dispatch action (e.g. < a href="/MyDispatch.do"/>.
> > >
> > > Now, it seems it's skipping my validation done in the
> > > action form.
> > >
> > > Can anyone tell me what I'm doing wrong OR is there a
> > > better way(I'm sure there is...). how about
> > > LookupDispatchAction?

Do not use LookupDispatchAction, use EventDispatchAction or even
better, EventActionDispatcher:
http://wiki.apache.org/struts/EventActionDispatcher

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message