You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Emi Lu <em...@encs.concordia.ca> on 2010/01/12 21:55:45 UTC
How struts2 supports "optgroup"?
Good afternoon,
Could someone tell me how struts2 support "optgroup" please?
Thanks a lot!
--
Lu Ying
<select>
<optgroup label="Australia">
<option value ="sydney">Sydney</option>
<option value ="melbourne">Melbourne</option>
</optgroup>
<optgroup label="New Zealand">
<option value ="cromwell">Cromwell</option>
<option value ="queenstown">Queenstown</option>
</optgroup>
</select>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How struts2 supports "optgroup"?
Posted by Felipe Lorenz <fe...@gmail.com>.
???? Nobody can help me?
On Wed, Feb 10, 2010 at 10:13 AM, Felipe Lorenz <fe...@gmail.com>wrote:
> Im sory, but the example at http://struts.apache.org/2.1.8.1/docs/optgroup
> .html is very simple. Dont have a real example...
>
> But anyway... Im trying to use s:optgroup without success..
>
> Here is how I did without struts tag:
>
> <select name="despesa.projeto.codigo">
> <s:iterator value="projetos">
> <s:if test="%{projetoCollection.size > 0}">
> <optgroup label="<s:property value="descricao" />">
> <s:iterator value="projetoCollection">
> <option value="<s:property value="codigo"/>"><s:property
> value="descricao"/></option>
> </s:iterator>
> </optgroup>
> </s:if>
> </s:iterator>
> </select>
>
> And here is how im trying to do:
>
> <s:select name="despesa.projeto.codigo" list="projeto">
> <s:optgroup label="%{descricao}" list="projetoCollection"
> listKey="codigo" listValue="descricao"/>
> </s:select>
>
> But the result I want something like this:
>
> <select name="despesa.projeto.codigo">
> <optgroup label="Blabla">
> <option value="53">Blabla</option>
> </optgroup>
> <optgroup label="IDEALOGIC">
> <option value="3">Assessoria de Comunicação</option>
> <option value="8">Capacitação de Clientes</option>
> <option value="11">Instalação/Manutenção servidor
> Idealogic</option>
> <option value="5">Prospecção</option>
> <option value="7">Prova de Conceito</option>
> <option value="2">Rotinas Administrativas</option>
> <option value="6">Visita Técnica</option>
> </optgroup>
> <optgroup label="OUTROS CLIENTES">
> <option value="31">Blabla</option>
> <option value="24">Blabla</option>
> <option value="51">Blabla</option>
> <option value="23">Blabla</option>
> <option value="30">Blabla</option>
> <option value="25">Blabla</option>
> <option value="32">Blabla</option>
> <option value="50">Blabla</option>
> </optgroup>
> </select>
>
> Thks.
>
>
>
> On Tue, Jan 12, 2010 at 7:39 PM, Gabriel Belingueres <
> belingueres@gmail.com> wrote:
>
>> http://struts.apache.org/2.1.8.1/docs/optgroup.html
>>
>> 2010/1/12 Emi Lu <em...@encs.concordia.ca>:
>> > Good afternoon,
>> >
>> > Could someone tell me how struts2 support "optgroup" please?
>> >
>> > Thanks a lot!
>> > --
>> > Lu Ying
>> >
>> >
>> > <select>
>> > <optgroup label="Australia">
>> > <option value ="sydney">Sydney</option>
>> > <option value ="melbourne">Melbourne</option>
>> > </optgroup>
>> > <optgroup label="New Zealand">
>> > <option value ="cromwell">Cromwell</option>
>> > <option value ="queenstown">Queenstown</option>
>> > </optgroup>
>> > </select>
>> >
>> > ---------------------------------------------------------------------
>> > 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
>>
>>
>
>
> --
> Felipe A. Lorenz
> Idealogic Software
> http://www.idealogic.com.br
>
--
Felipe A. Lorenz
Idealogic Software
http://www.idealogic.com.br
Re: How struts2 supports "optgroup"?
Posted by Felipe Lorenz <fe...@gmail.com>.
Im sory, but the example at http://struts.apache.org/2.1.8.1/docs/optgroup
.html is very simple. Dont have a real example...
But anyway... Im trying to use s:optgroup without success..
Here is how I did without struts tag:
<select name="despesa.projeto.codigo">
<s:iterator value="projetos">
<s:if test="%{projetoCollection.size > 0}">
<optgroup label="<s:property value="descricao" />">
<s:iterator value="projetoCollection">
<option value="<s:property value="codigo"/>"><s:property
value="descricao"/></option>
</s:iterator>
</optgroup>
</s:if>
</s:iterator>
</select>
And here is how im trying to do:
<s:select name="despesa.projeto.codigo" list="projeto">
<s:optgroup label="%{descricao}" list="projetoCollection" listKey="codigo"
listValue="descricao"/>
</s:select>
But the result I want something like this:
<select name="despesa.projeto.codigo">
<optgroup label="Blabla">
<option value="53">Blabla</option>
</optgroup>
<optgroup label="IDEALOGIC">
<option value="3">Assessoria de Comunicação</option>
<option value="8">Capacitação de Clientes</option>
<option value="11">Instalação/Manutenção servidor
Idealogic</option>
<option value="5">Prospecção</option>
<option value="7">Prova de Conceito</option>
<option value="2">Rotinas Administrativas</option>
<option value="6">Visita Técnica</option>
</optgroup>
<optgroup label="OUTROS CLIENTES">
<option value="31">Blabla</option>
<option value="24">Blabla</option>
<option value="51">Blabla</option>
<option value="23">Blabla</option>
<option value="30">Blabla</option>
<option value="25">Blabla</option>
<option value="32">Blabla</option>
<option value="50">Blabla</option>
</optgroup>
</select>
Thks.
On Tue, Jan 12, 2010 at 7:39 PM, Gabriel Belingueres
<be...@gmail.com>wrote:
> http://struts.apache.org/2.1.8.1/docs/optgroup.html
>
> 2010/1/12 Emi Lu <em...@encs.concordia.ca>:
> > Good afternoon,
> >
> > Could someone tell me how struts2 support "optgroup" please?
> >
> > Thanks a lot!
> > --
> > Lu Ying
> >
> >
> > <select>
> > <optgroup label="Australia">
> > <option value ="sydney">Sydney</option>
> > <option value ="melbourne">Melbourne</option>
> > </optgroup>
> > <optgroup label="New Zealand">
> > <option value ="cromwell">Cromwell</option>
> > <option value ="queenstown">Queenstown</option>
> > </optgroup>
> > </select>
> >
> > ---------------------------------------------------------------------
> > 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
>
>
--
Felipe A. Lorenz
Idealogic Software
http://www.idealogic.com.br
Re: How struts2 supports "optgroup"?
Posted by Gabriel Belingueres <be...@gmail.com>.
http://struts.apache.org/2.1.8.1/docs/optgroup.html
2010/1/12 Emi Lu <em...@encs.concordia.ca>:
> Good afternoon,
>
> Could someone tell me how struts2 support "optgroup" please?
>
> Thanks a lot!
> --
> Lu Ying
>
>
> <select>
> <optgroup label="Australia">
> <option value ="sydney">Sydney</option>
> <option value ="melbourne">Melbourne</option>
> </optgroup>
> <optgroup label="New Zealand">
> <option value ="cromwell">Cromwell</option>
> <option value ="queenstown">Queenstown</option>
> </optgroup>
> </select>
>
> ---------------------------------------------------------------------
> 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