struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Barefoot" <jose...@hereuare.com>
Subject RE: i18n
Date Wed, 19 Jun 2002 19:11:31 GMT
You can put it however you like, but if you don't have a getAction() and
setAction() as James describes, then the value "Edit Coverage" will never be
stored anywhere.  Add these to your form and then retrieve the value from
the form bean associated with your action class as he also described, and
match the value to determine the action.

Or you can retrieve it directly from the request (i.e.
request.getParameter("action")), if you want to break Struts MVC concepts.

Or, finally, you can use a different property name (e.g. editAction,
cancelAction, continueAction) for each of the buttons (and add getter/setter
pairs for these properties to the form bean), and then it doesn't matter
what the value attribute is set to.  Just check to see which of the three
properties (form fields) has a value instead.  The one that isn't null will
be the one that was clicked.


peace,
Joe

> -----Original Message-----
> From: Carlos Fernandez [mailto:Carlos.Fernandez@S1.com]
> Sent: Tuesday, June 18, 2002 11:38 AM
> To: 'Struts Users Mailing List'
> Subject: RE: i18n
>
>
> Nope. I will put it this way. I have 3 buttons un my JSP. Cancel, continue
> and Edit. How do I know which button was pressed in my action class?. The
> way how I implement the buttons is :
>
> >   <i18n:image
> >    pageproperty="buttonEditImage"
> >    altProperty="buttonEditText"
> >    property="action"
> >    value="Edit_Coverage"
> >    border="0"/>
>
> That example goes for the "edit" button.
>
> -Carlos
>
>
> -----Original Message-----
> From: James Mitchell [mailto:jmitchtx@telocity.com]
> Sent: Tuesday, June 18, 2002 2:29 PM
> To: Struts Users Mailing List
> Subject: RE: i18n
>
>
> I'm assuming by your using the property="action", that you have a field on
> your form for action (getAction() and setAction())....
>
> MyActionForm frm = (MyActionForm) form;
> String action = frm.getAction()
> if (action != null) {
>   // insert code here
> }
>
> You might also look into the DispatchAction, its very easily
> implemented and
> it can be a real timesaver.
> See Chuck's book (Chapter 5 around page 23)
> You can get review online at:
> http://www.theserverside.com/resources/strutsreview.jsp
>
>
>
>
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network"
> http://struts-atlanta.open-tools.org
>
> > -----Original Message-----
> > From: Carlos Fernandez [mailto:Carlos.Fernandez@S1.com]
> > Sent: Tuesday, June 18, 2002 1:24 PM
> > To: 'jmitchtx@telocity.com'
> > Subject: RE: i18n
> >
> >
> > WEll, that code is placed in the JSP. It's a button. I want to
> > know when the
> > button is pressed. Is that clear enough?
> >
> >
> > -----Original Message-----
> > From: James Mitchell [mailto:jmitchtx@telocity.com]
> > Sent: Tuesday, June 18, 2002 12:12 PM
> > To: Struts Users Mailing List
> > Subject: RE: i18n
> >
> >
> > You'll have to restate your question with a little more clarity please.
> > I, personally, have no clue what it is you need.
> >
> > James Mitchell
> > Software Engineer\Struts Evangelist
> > Struts-Atlanta, the "Open Minded Developer Network"
> > http://struts-atlanta.open-tools.org
> >
> >   -----Original Message-----
> >   From: Carlos Fernandez [mailto:Carlos.Fernandez@S1.com]
> >   Sent: Tuesday, June 18, 2002 11:52 AM
> >   To: Struts (E-mail)
> >   Subject: i18n
> >
> >
> >   Does anyone know how to get the data stored in "value" from de action
> > class?
> >
> >   <i18n:image
> >    pageproperty="buttonEditImage"
> >    altProperty="buttonEditText"
> >    property="action"
> >    value="Edit_Coverage"
> >    border="0"/>
> >
> >
> >   Thanks
> >
> >
> >   -Carlos.
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


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


Mime
View raw message