struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Lorenz <felipe.lor...@gmail.com>
Subject Re: How struts2 supports "optgroup"?
Date Wed, 10 Feb 2010 13:13:52 GMT
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&#xE7;&#xE3;o</option>
    <option value="8">Capacita&#xE7;&#xE3;o de Clientes</option>
    <option value="11">Instala&#xE7;&#xE3;o/Manuten&#xE7;&#xE3;o servidor
Idealogic</option>
    <option value="5">Prospec&#xE7;&#xE3;o</option>
    <option value="7">Prova de Conceito</option>
    <option value="2">Rotinas Administrativas</option>
    <option value="6">Visita T&#xE9;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 <emilu@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message