struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Barefoot" <jose...@hereuare.com>
Subject RE: localize the submit buuton
Date Thu, 20 Jun 2002 22:55:36 GMT
Or you can use a different field for each possible submit button, so that
way it doesn't matter what value the field has--in the setters for these
fields, you can just set a "mode" instead (an int), and use that to detemine
what action to take.

e.g.

properties named like so:
cancelAction
retrieveAction
processAction


// In your form class:

public static final int MODE_INIT		  = 0;
public static final int MODE_PROCESS_ACTION = 1;

int mode;
getMode(){	
	return mode;
}

setProcessAction(String s){
	// don't care what value the string has
	mode = MODE_PROCESS_ACTION;
}


// In your action class:

perform(){

// ...

switch( form.getMode() )

	case MODE_PROCESS_ACTION:

	case MODE_RETRIEVE_ACTION:
}

}

> -----Original Message-----
> From: James Mitchell [mailto:jmitchtx@telocity.com]
> Sent: Wednesday, June 19, 2002 3:41 PM
> To: Struts Users Mailing List
> Subject: RE: localize the submit buuton
> 
> 
> ApplicationResources.properties
> ---------------------------------
> mypage.submit.label=
> mypage.cancel.label=
> 
> ApplicationResources_fr.properties
> ---------------------------------
> mypage.submit.label=soumettez
> mypage.cancel.label=annulation
> 
> ApplicationResources_de.properties
> ---------------------------------
> mypage.submit.label=reichen Sie ein
> mypage.cancel.label=Löschen
> 
> 
> 
> in jsp......
> 
> <html:submit property="action">
>   <bean:message key="mypage.submit.label"/>
> </html:submit>
> 
> This will put the i18n value into your form.setAction(),
> then in your action class,
> compare the localized action to the form.getAction()
> 
> Hope that helps!!!
> 
> 
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network"
> http://struts-atlanta.open-tools.org
> 
> > -----Original Message-----
> > From: Billy Ng [mailto:evebill8@hotmail.com]
> > Sent: Wednesday, June 19, 2002 5:59 PM
> > To: Struts Users Mailing List
> > Subject: localize the submit buuton
> >
> >
> > if I use taglib to generate the submit button
> >
> > <html:submit property="submit" value="Enter"/>
> >
> > how I can localize the button's value with using <bean:message> tag?
> >
> > Billy Ng
> >
> 
> 
> --
> 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