You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Thielen <da...@windward.net> on 2006/01/20 23:25:09 UTC

submit button value vs displayed text

Hi;

 

When I create a button I would like for the value="add" to always have the
text add - for my programming that uses that value to determine which button
was pressed.

 

However, I want the displayed text to come from a resource so it is
localized. Is there a way to do this? It appears that the value= if set, is
always placed in the button.

 

??? - thanks - dave

 

 

David Thielen

www.windwardreports.com

303-499-2544

 


Re: submit button value vs displayed text

Posted by Dakota Jack <da...@gmail.com>.
Checkout www.michaelmcgrady.com and click on the button ideas link.  All the
code for each option is there.  I would suggest the so-called "(new) LOOKUP
DISPATCH ACTION SOLUTION".  With this solution internationalizing your
button is easy.  McGrady uses a processes that automatically makes gif
buttons and is both capable of i18n and change of font and color.  He has a
special taglib for doing that.  Ask him and he might give it to you.

On 1/20/06, David Thielen <da...@windward.net> wrote:
>
> Hi;
>
>
>
> When I create a button I would like for the value="add" to always have the
> text add - for my programming that uses that value to determine which
> button
> was pressed.
>
>
>
> However, I want the displayed text to come from a resource so it is
> localized. Is there a way to do this? It appears that the value= if set,
> is
> always placed in the button.
>
>
>
> ??? - thanks - dave
>
>
>
>
>
> David Thielen
>
> www.windwardreports.com
>
> 303-499-2544
>
>
>
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

Re: submit button value vs displayed text

Posted by Michael Jouravlev <jm...@gmail.com>.
On 1/20/06, David Thielen <da...@windward.net> wrote:
> Hi;
>
> When I create a button I would like for the value="add" to always have the
> text add - for my programming that uses that value to determine which button
> was pressed.
>
> However, I want the displayed text to come from a resource so it is
> localized. Is there a way to do this? It appears that the value= if set, is
> always placed in the button.
>

value == button caption.

Use dispatching action to distinguish, which button was clicked, for example:

http://superinterface.com/strutsdialog/selectaction.html
http://struts.sourceforge.net/strutsdialogs/selectaction.html

or check out this:

http://issues.apache.org/bugzilla/show_bug.cgi?id=30292

Or use LookupDispatchAction, but it has its drawbacks. Basic
DispatchAction is quite limited in terms of setting the button
caption.

Michael.

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