You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Juan Pablo Pizarro <ju...@gmail.com> on 2008/06/26 17:40:09 UTC
Help with Combobox
Hello, All.
I've a problem, I usa a combobox to show options in a page, but I need
keep the id and show the description.
I use Apache Tomcat 5.5 and Struts 2.0.11
My bean has:
private String technology;
private Collection<Technology> lstTechnology;
My page has:
<s:combobox label="%{getText('technology')}" name="technology"
readonly="true" headerValue="--- Please Select ---" headerKey="1"
listKey="lstTechology" list="lstTechnology.{shortDesc}" />
Thanks!
JP
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help with Combobox
Posted by roriveram <to...@gmail.com>.
Help me whit this code:
<s:form>
<s:action name="IterateDemo" var="customers" >
<s:bean name="tags.iterate.action.Combo" var="customers">
<s:param name="customers.name" value="text{'name'}"/>
<s:combobox label="Nombres" name="nombres" headerValue="--
Select --" headerKey="1"
list="#customers" listValue="customers" size="15"/>
</s:bean>
</s:action>
</s:form>
Struts.xml:
<action name="IterateDemo" method="execute"
class="tags.iterate.action.Combo">
<result name="input">/tags/iteratedemo.jsp</result>
<result name="SUCCESS">/tags/iteratedemo.jsp</result>
</action>
The combobox is empty... why?????
Juan Pablo Pizarro wrote:
>
> Thanks!!
>
> It works fine!
>
> Regards.
>
> 2008/6/26 Lukasz Lenart <lu...@googlemail.com>:
>> 2008/6/26 Juan Pablo Pizarro <ju...@gmail.com>:
>>> Sorry, I use:
>>>
>>> <s:combobox label="%{getText('technology')}"
>>> name="technology" readonly="true"
>>> headerValue="--- Please Select ---"
>>> headerKey="1"
>>> list="lstTechnology.{shortDesc}"/>
>>
>> It should be like this
>>
>> list="lstTechnology"
>> listKey="technologyId" - this will be the value of technology
>> listValue="technologyLabel" - what will user see
>>
>>
>> Regards
>> --
>> Lukasz
>> http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Help-with-Combobox-tp18137053p25640995.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help with Combobox
Posted by Juan Pablo Pizarro <ju...@gmail.com>.
Thanks!!
It works fine!
Regards.
2008/6/26 Lukasz Lenart <lu...@googlemail.com>:
> 2008/6/26 Juan Pablo Pizarro <ju...@gmail.com>:
>> Sorry, I use:
>>
>> <s:combobox label="%{getText('technology')}"
>> name="technology" readonly="true"
>> headerValue="--- Please Select ---" headerKey="1"
>> list="lstTechnology.{shortDesc}"/>
>
> It should be like this
>
> list="lstTechnology"
> listKey="technologyId" - this will be the value of technology
> listValue="technologyLabel" - what will user see
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help with Combobox
Posted by Lukasz Lenart <lu...@googlemail.com>.
2008/6/26 Juan Pablo Pizarro <ju...@gmail.com>:
> Sorry, I use:
>
> <s:combobox label="%{getText('technology')}"
> name="technology" readonly="true"
> headerValue="--- Please Select ---" headerKey="1"
> list="lstTechnology.{shortDesc}"/>
It should be like this
list="lstTechnology"
listKey="technologyId" - this will be the value of technology
listValue="technologyLabel" - what will user see
Regards
--
Lukasz
http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help with Combobox
Posted by Juan Pablo Pizarro <ju...@gmail.com>.
Sorry, I use:
<s:combobox label="%{getText('technology')}"
name="technology" readonly="true"
headerValue="--- Please Select ---" headerKey="1"
list="lstTechnology.{shortDesc}"/>
JP
2008/6/26 Dave Newton <ne...@yahoo.com>:
> Use listValue?
>
> Dave
>
>
> --- On Thu, 6/26/08, Juan Pablo Pizarro <ju...@gmail.com> wrote:
>
>> From: Juan Pablo Pizarro <ju...@gmail.com>
>> Subject: Help with Combobox
>> To: "Struts Users Mailing List" <us...@struts.apache.org>
>> Date: Thursday, June 26, 2008, 11:40 AM
>> Hello, All.
>>
>> I've a problem, I usa a combobox to show options in a
>> page, but I need
>> keep the id and show the description.
>>
>> I use Apache Tomcat 5.5 and Struts 2.0.11
>>
>> My bean has:
>>
>> private String technology;
>> private Collection<Technology> lstTechnology;
>>
>> My page has:
>>
>> <s:combobox
>> label="%{getText('technology')}"
>> name="technology"
>> readonly="true" headerValue="--- Please
>> Select ---" headerKey="1"
>> listKey="lstTechology"
>> list="lstTechnology.{shortDesc}" />
>>
>> Thanks!
>>
>> JP
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help with Combobox
Posted by Dave Newton <ne...@yahoo.com>.
Use listValue?
Dave
--- On Thu, 6/26/08, Juan Pablo Pizarro <ju...@gmail.com> wrote:
> From: Juan Pablo Pizarro <ju...@gmail.com>
> Subject: Help with Combobox
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Date: Thursday, June 26, 2008, 11:40 AM
> Hello, All.
>
> I've a problem, I usa a combobox to show options in a
> page, but I need
> keep the id and show the description.
>
> I use Apache Tomcat 5.5 and Struts 2.0.11
>
> My bean has:
>
> private String technology;
> private Collection<Technology> lstTechnology;
>
> My page has:
>
> <s:combobox
> label="%{getText('technology')}"
> name="technology"
> readonly="true" headerValue="--- Please
> Select ---" headerKey="1"
> listKey="lstTechology"
> list="lstTechnology.{shortDesc}" />
>
> Thanks!
>
> JP
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org