You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ma...@yahoo.com on 2009/12/22 17:15:56 UTC

[S2] can't use ENUM type

Hi,

I got problem to using ENUM type in <s:select>, here is my code:

<s:select label="Sex"
       name="user.sex"
       list="getComboBox(ComboBoxType.SEX)"
       listKey="key"
       listValue="value"
       value="user.sex"/>

but if I change to use String (e.g: list="getComboBox('SEX')"),
and do the conversion in the action then it working fine.

Is it a bug?

Regards
LV

Re: [S2] can't use ENUM type

Posted by ma...@yahoo.com.
Hi,

Thanks,my getComboBox accepting ComboBoxType, and I use @package.path.ComboBoxType@SEX is working fine now.

Regards
LV



________________________________
From: Steven Yang <ke...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Wed, December 23, 2009 1:26:48 AM
Subject: Re: [S2] <s:select> can't use ENUM type

what does "getComboBox" accepting? an Enum value or Enum array?
if an Enum value then you have to do @{include full package
path}ComboBoxType@SEX

On Wed, Dec 23, 2009 at 12:15 AM, <ma...@yahoo.com> wrote:

> Hi,
>
> I got problem to using ENUM type in <s:select>, here is my code:
>
> <s:select label="Sex"
>       name="user.sex"
>       list="getComboBox(ComboBoxType.SEX)"
>       listKey="key"
>       listValue="value"
>       value="user.sex"/>
>
> but if I change to use String (e.g: list="getComboBox('SEX')"),
> and do the conversion in the action then it working fine.
>
> Is it a bug?
>
> Regards
> LV

Re: [S2] can't use ENUM type

Posted by Steven Yang <ke...@gmail.com>.
what does "getComboBox" accepting? an Enum value or Enum array?
if an Enum value then you have to do @{include full package
path}ComboBoxType@SEX

On Wed, Dec 23, 2009 at 12:15 AM, <ma...@yahoo.com> wrote:

> Hi,
>
> I got problem to using ENUM type in <s:select>, here is my code:
>
> <s:select label="Sex"
>       name="user.sex"
>       list="getComboBox(ComboBoxType.SEX)"
>       listKey="key"
>       listValue="value"
>       value="user.sex"/>
>
> but if I change to use String (e.g: list="getComboBox('SEX')"),
> and do the conversion in the action then it working fine.
>
> Is it a bug?
>
> Regards
> LV