You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rafael Dittberner <ra...@tre-df.gov.br> on 2007/06/06 22:11:14 UTC

[S2] issues

This is my code:

<s:select name="autoridade.orgao.codObjeto" list="orgaos" 
listKey="codObjeto" listValue="nome" label="Orgão" 
value="%{autoridade.orgao.codObjeto.toString()}" />

<s:select name="autoridade.cargo.codObjeto" list="cargos" 
listKey="codObjeto" listValue="nome" label="Cargo" 
value="%{autoridade.cargo.codObjeto}" />

Someone please explain to me why in the first one i had to use 
toString() to make it work, but the second one works perfectly as is?

-- 
Rafael Dittberner
Brasília (DF) - Brasil

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


Re: [S2] issues

Posted by Marco Carnevale <ma...@gmail.com>.
Good question.  I am guessing it is a bug.

On 6/8/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
>
> Yes.
>
> Looking at the data I´ve found out that in the case of Cargo the highest
> codObjeto is 100, while in the case of Orgao codObjeto goes beyond 1500.
>
> I think I´m going to use your solution as well.
>
> But is this the correct behaviour or is it a bug?
>
> Thank you Marco.
>
> Rafael Dittberner
>
> Marco Carnevale escreveu:
> > I encountered a similar issue before as well.  I ended up always using
> the
> > toString method.  (Don't forget to check for null)
> >
> > What I found was that when the Integers we small (5, 50, 100, ect...)
> the
> > select box would match it correctly.  However when the id was a larger
> > Integer such as 10000 the select would not match it correctly without
> the
> > toString.
> >
> > Is this the case with your data in the example that you gave?
> >
> > Marco
> >
> >
> > On 6/8/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
> >>
> >> They are both Integer.
> >>
> >> Rafael Dittberner
> >>
> >> Vincent Lin escreveu:
> >> > What is the data type of autoridade.orgao.codObjeto and
> >> > autoridade.cargo.codObjeto?
> >> >
> >> > On 6/7/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
> >> >>
> >> >> This is my code:
> >> >>
> >> >> <s:select name="autoridade.orgao.codObjeto" list="orgaos"
> >> >> listKey="codObjeto" listValue="nome" label="Orgão"
> >> >> value="%{autoridade.orgao.codObjeto.toString()}" />
> >> >>
> >> >> <s:select name="autoridade.cargo.codObjeto" list="cargos"
> >> >> listKey="codObjeto" listValue="nome" label="Cargo"
> >> >> value="%{autoridade.cargo.codObjeto}" />
> >> >>
> >> >> Someone please explain to me why in the first one i had to use
> >> >> toString() to make it work, but the second one works perfectly as
> is?
> >> >>
> >> >> --
> >> >> Rafael Dittberner
> >> >> Brasília (DF) - Brasil
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> 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: [S2] issues

Posted by Rafael Dittberner <ra...@tre-df.gov.br>.
Yes.

Looking at the data I´ve found out that in the case of Cargo the highest 
codObjeto is 100, while in the case of Orgao codObjeto goes beyond 1500.

I think I´m going to use your solution as well.

But is this the correct behaviour or is it a bug?

Thank you Marco.

Rafael Dittberner

Marco Carnevale escreveu:
> I encountered a similar issue before as well.  I ended up always using the
> toString method.  (Don't forget to check for null)
> 
> What I found was that when the Integers we small (5, 50, 100, ect...) the
> select box would match it correctly.  However when the id was a larger
> Integer such as 10000 the select would not match it correctly without the
> toString.
> 
> Is this the case with your data in the example that you gave?
> 
> Marco
> 
> 
> On 6/8/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
>>
>> They are both Integer.
>>
>> Rafael Dittberner
>>
>> Vincent Lin escreveu:
>> > What is the data type of autoridade.orgao.codObjeto and
>> > autoridade.cargo.codObjeto?
>> >
>> > On 6/7/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
>> >>
>> >> This is my code:
>> >>
>> >> <s:select name="autoridade.orgao.codObjeto" list="orgaos"
>> >> listKey="codObjeto" listValue="nome" label="Orgão"
>> >> value="%{autoridade.orgao.codObjeto.toString()}" />
>> >>
>> >> <s:select name="autoridade.cargo.codObjeto" list="cargos"
>> >> listKey="codObjeto" listValue="nome" label="Cargo"
>> >> value="%{autoridade.cargo.codObjeto}" />
>> >>
>> >> Someone please explain to me why in the first one i had to use
>> >> toString() to make it work, but the second one works perfectly as is?
>> >>
>> >> --
>> >> Rafael Dittberner
>> >> Brasília (DF) - Brasil
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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: [S2] issues

Posted by Marco Carnevale <ma...@gmail.com>.
I encountered a similar issue before as well.  I ended up always using the
toString method.  (Don't forget to check for null)

What I found was that when the Integers we small (5, 50, 100, ect...) the
select box would match it correctly.  However when the id was a larger
Integer such as 10000 the select would not match it correctly without the
toString.

Is this the case with your data in the example that you gave?

Marco


On 6/8/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
>
> They are both Integer.
>
> Rafael Dittberner
>
> Vincent Lin escreveu:
> > What is the data type of autoridade.orgao.codObjeto and
> > autoridade.cargo.codObjeto?
> >
> > On 6/7/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
> >>
> >> This is my code:
> >>
> >> <s:select name="autoridade.orgao.codObjeto" list="orgaos"
> >> listKey="codObjeto" listValue="nome" label="Orgão"
> >> value="%{autoridade.orgao.codObjeto.toString()}" />
> >>
> >> <s:select name="autoridade.cargo.codObjeto" list="cargos"
> >> listKey="codObjeto" listValue="nome" label="Cargo"
> >> value="%{autoridade.cargo.codObjeto}" />
> >>
> >> Someone please explain to me why in the first one i had to use
> >> toString() to make it work, but the second one works perfectly as is?
> >>
> >> --
> >> Rafael Dittberner
> >> Brasília (DF) - Brasil
> >>
> >> ---------------------------------------------------------------------
> >> 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: [S2] issues

Posted by Rafael Dittberner <ra...@tre-df.gov.br>.
They are both Integer.

Rafael Dittberner

Vincent Lin escreveu:
> What is the data type of autoridade.orgao.codObjeto and
> autoridade.cargo.codObjeto?
> 
> On 6/7/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
>>
>> This is my code:
>>
>> <s:select name="autoridade.orgao.codObjeto" list="orgaos"
>> listKey="codObjeto" listValue="nome" label="Orgão"
>> value="%{autoridade.orgao.codObjeto.toString()}" />
>>
>> <s:select name="autoridade.cargo.codObjeto" list="cargos"
>> listKey="codObjeto" listValue="nome" label="Cargo"
>> value="%{autoridade.cargo.codObjeto}" />
>>
>> Someone please explain to me why in the first one i had to use
>> toString() to make it work, but the second one works perfectly as is?
>>
>> -- 
>> Rafael Dittberner
>> Brasília (DF) - Brasil
>>
>> ---------------------------------------------------------------------
>> 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: [S2] issues

Posted by Vincent Lin <vi...@gmail.com>.
What is the data type of autoridade.orgao.codObjeto and
autoridade.cargo.codObjeto?

On 6/7/07, Rafael Dittberner <ra...@tre-df.gov.br> wrote:
>
> This is my code:
>
> <s:select name="autoridade.orgao.codObjeto" list="orgaos"
> listKey="codObjeto" listValue="nome" label="Orgão"
> value="%{autoridade.orgao.codObjeto.toString()}" />
>
> <s:select name="autoridade.cargo.codObjeto" list="cargos"
> listKey="codObjeto" listValue="nome" label="Cargo"
> value="%{autoridade.cargo.codObjeto}" />
>
> Someone please explain to me why in the first one i had to use
> toString() to make it work, but the second one works perfectly as is?
>
> --
> Rafael Dittberner
> Brasília (DF) - Brasil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>