RE: how to Internationalized submit button?

2002-07-19 Thread René Eigenheer

i use different properties for each button:

example:
 
 

if (btnStore != null) {
}
if (btnCancel != null) {
}



> -Original Message-
> From: Hoang, Hai [mailto:[EMAIL PROTECTED]]
> Sent: Freitag, 19. Juli 2002 05:56
> To: '[EMAIL PROTECTED]'
> Subject: how to Internationalized submit button?
>
>
> I want to internationalize the submit buttons on a form and I
> don't know how
> to do it.  Currently, I mapped the value on the submit button to the
> property actionName in the ActionForm class.  Base on the
> button the use
> clicked, I handle it propriately in the Action class, just like event
> handling mechanism.  Now if I internationalize these buttons
> ( property="actionName"/> key="button.add"/>, the
> value will change and my Action class will no longer work.
> Is there a way
> to work around this problem?
>
> To be specific, following is the detail about my setup
>
> 1. jsp page:
>
> 
> 
> 
>
> 2. actionForm class:
>
> public String getActionName()
> {
>   return actionName;
> }
>
> public void setActionName( String actionName)
> {
>   this.actionName = actionName;
> }
>
>
> 3. action class:
>
> ApplicationForm applicationForm = (ApplicationForm)form;
> String action = applicationForm.getActionName();
> if (action == null)
> {
>   action = Constants.BUTTON_CANCEL;
> }
>
> if (action.equals(Constants.BUTTON_CANCEL))
> {
>   applicationForm.setActionName(null);
>   doAdd(mapping, applicationForm, request, response);
> }
> else if (action.equals(Constants.BUTTON_ADD))
> {
> doAdd(mapping, applicationForm, request, response);
> }
> else if (action.equals(Constants.BUTTON_SAVE))
> {
> doSave(mapping, applicationForm, request, response);
> }
> else if (action.equals(Constants.BUTTON_EDIT) ||
>   action.equals(Constants.BUTTON_REMOVE))
> {
> doEdit(mapping, applicationForm, request, response);
> }
> else if (action.equals(Constants.BUTTON_UPDATE))
> {
> doUpdate(mapping, applicationForm, request, response);
> }
> else if (action.equals(Constants.BUTTON_DELETE))
> {
> doDelete(mapping, applicationForm, request, response);
> }
>
> Thank you for your help
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: how to Internationalized submit button?

2002-07-18 Thread Tadashi Ishikawa
You can use hidden field and Javascript.


function setAction(target) {
document.forms[0].actionName.value=target;
}


$B!D(B








Hoang, Hai wrote:

>I want to internationalize the submit buttons on a form and I don't know how
>to do it.  Currently, I mapped the value on the submit button to the
>property actionName in the ActionForm class.  Base on the button the use
>clicked, I handle it propriately in the Action class, just like event
>handling mechanism.  Now if I internationalize these buttons (property="actionName"/>, the
>value will change and my Action class will no longer work.  Is there a way
>to work around this problem?
>
>To be specific, following is the detail about my setup
>
>1. jsp page:
>
>
>
>
>
>2. actionForm class:
>
>public String getActionName() 
>{
>   return actionName;
>}
>
>public void setActionName( String actionName) 
>{
>   this.actionName = actionName;
>}
>
>
>3. action class:
>
>ApplicationForm applicationForm = (ApplicationForm)form;
>String action = applicationForm.getActionName();
>if (action == null)
>{
>   action = Constants.BUTTON_CANCEL;
>}
>
>if (action.equals(Constants.BUTTON_CANCEL))
>{
>   applicationForm.setActionName(null);
>   doAdd(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_ADD)) 
>{
>doAdd(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_SAVE)) 
>{
>doSave(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_EDIT) || 
>   action.equals(Constants.BUTTON_REMOVE)) 
>{
>doEdit(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_UPDATE)) 
>{
>doUpdate(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_DELETE)) 
>{
>doDelete(mapping, applicationForm, request, response);
>}
>
>Thank you for your help
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>
>