You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Roger <ro...@googlemail.com> on 2008/09/01 20:41:24 UTC

Possible bug with Struts 2.0.11

Hi

Using the <s:select> tag when getting the data from the action, appears not to 
retrieve the label text from my resource bundle. but when I list the options 
in the jsp it does. So;

<s:select label="label.homeInsurance.details.housetype"
                                  name="housetype"
                                  list="houseType"
                                  required="true"
                                  headerKey="-1"
                                  headerValue="--Select--"
                                 cssClass="select"
                                  /> 

displays "label.homeInsurance.details.housetype" as the text for the label 
whereas;

<s:select key="label.homeInsurance.details.owner"
                                  name="owner"
                                  headerKey="-1"
                                  headerValue="--Select--"
                                  
list="#{'01':'Owner', '02':'Tenant','03':'Other'}"
                                  required = "true"
                                  cssClass="select"/>
correctly displays the text from my resource bundle.

Have I missed something before I report a bug?         

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


Re: Possible bug with Struts 2.0.11

Posted by Dave Newton <ne...@yahoo.com>.
--- On Mon, 9/1/08, Roger wrote:
> Using the <s:select> tag when getting the data from
> the action, appears not to  retrieve the label text 
> from my resource bundle. but when I list the options 
> in the jsp it does. So;
> 
> <s:select
>   label="label.homeInsurance.details.housetype"
>   name="housetype"                                  
>   list="houseType"
>   required="true"
>   headerKey="-1"
>   headerValue="--Select--"
>   cssClass="select"
>   /> 
> 
> displays "label.homeInsurance.details.housetype"
> as the text for the label whereas;
> 
> <s:select 
>   key="label.homeInsurance.details.owner"
>   name="owner"
>   headerKey="-1"
>   headerValue="--Select--"
>   list="#{'01':'Owner','02':'Tenant','03':'Other'}"
>   required = "true"
>   cssClass="select"/>
>
> correctly displays the text from my resource bundle.
> 
> Have I missed something before I report a bug?         

In the first usage you're specifying the "label" attribute, which will use whatever string you put in there. You may use a getText(...) call.

The second instance uses the "key" attribute, which does multiple things, one of which is set the label text by doing the resource lookup automagically.

It's not related to how the list is supplied.

Dave


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