You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by TNO <tn...@free.fr> on 2007/11/15 16:50:02 UTC

[T5] Simple question about select and enum

Hi,

I want to create a very simple select list from an enum.

<t:select model="${reportModel}" value="${report}"/>

But in a select component, the model (org.apache.tapestry.SelectModel)
is required, I try to use EnumSelectModel but it did not work...
I can't have my enum list...

please help, thanks

Tom



---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 071114-0, 14/11/2007
Analyse le : 15/11/2007 16:50:02
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Simple question about select and enum

Posted by martin boulanger <ma...@atosorigin.com>.
Hi,

Try this :
in your Page.html :

<t:select id="enumVar" value="enumVar"/>
---------------------

in Page.java :

EnumType enumVar;

-------------------

in your EnumeType.java

public enum EnumeType{
	val1,Val2,Val3;
}



TNO wrote:
> 
> Hi,
> 
> I want to create a very simple select list from an enum.
> 
> <t:select model="${reportModel}" value="${report}"/>
> 
> But in a select component, the model (org.apache.tapestry.SelectModel)
> is required, I try to use EnumSelectModel but it did not work...
> I can't have my enum list...
> 
> please help, thanks
> 
> Tom
> 
> 
> 
> ---
> Antivirus avast! : message Sortant sain.
> Base de donnees virale (VPS) : 071114-0, 14/11/2007
> Analyse le : 15/11/2007 16:50:02
> avast! - copyright (c) 1988-2007 ALWIL Software.
> http://www.avast.com
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-T5--Simple-question-about-select-and-enum-tf4815229.html#a13776401
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Simple question about select and enum

Posted by TNO <tn...@free.fr>.
It works ! thanks
but the Component Reference says that parameter "model" is required...

lasitha a écrit :
> Tom, try it without specifing a select model.
>
> The following is working for me:
> <t:select clientId="report" value="report" />
>
> Where the page class has just the report property and accessors.
>
> Also note that you don't need to use expansions (the ${..}s) on these.
>
> Cheers,
> lasitha.
>
> On Nov 15, 2007 10:00 PM, Michael Courcy <mi...@gmail.com> wrote:
>   
>> Do you have error messages ?
>>
>> TNO a écrit :
>>
>>     
>>> Hi,
>>>
>>> I want to create a very simple select list from an enum.
>>>
>>> <t:select model="${reportModel}" value="${report}"/>
>>>
>>> But in a select component, the model (org.apache.tapestry.SelectModel)
>>> is required, I try to use EnumSelectModel but it did not work...
>>> I can't have my enum list...
>>>
>>> please help, thanks
>>>
>>> Tom
>>>
>>>
>>>
>>> ---
>>> Antivirus avast! : message Sortant sain.
>>> Base de donnees virale (VPS) : 071114-0, 14/11/2007
>>> Analyse le : 15/11/2007 16:50:02
>>> avast! - copyright (c) 1988-2007 ALWIL Software.
>>> http://www.avast.com
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>       
>> --
>> Michael Courcy
>> http://courcy.blogspot.com
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
>   



---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 071114-0, 14/11/2007
Analyse le : 15/11/2007 18:25:38
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com



Re: [T5] Simple question about select and enum

Posted by lasitha <la...@gmail.com>.
Tom, try it without specifing a select model.

The following is working for me:
<t:select clientId="report" value="report" />

Where the page class has just the report property and accessors.

Also note that you don't need to use expansions (the ${..}s) on these.

Cheers,
lasitha.

On Nov 15, 2007 10:00 PM, Michael Courcy <mi...@gmail.com> wrote:
> Do you have error messages ?
>
> TNO a écrit :
>
> > Hi,
> >
> > I want to create a very simple select list from an enum.
> >
> > <t:select model="${reportModel}" value="${report}"/>
> >
> > But in a select component, the model (org.apache.tapestry.SelectModel)
> > is required, I try to use EnumSelectModel but it did not work...
> > I can't have my enum list...
> >
> > please help, thanks
> >
> > Tom
> >
> >
> >
> > ---
> > Antivirus avast! : message Sortant sain.
> > Base de donnees virale (VPS) : 071114-0, 14/11/2007
> > Analyse le : 15/11/2007 16:50:02
> > avast! - copyright (c) 1988-2007 ALWIL Software.
> > http://www.avast.com
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
>
>
> --
> Michael Courcy
> http://courcy.blogspot.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Simple question about select and enum

Posted by TNO <tn...@free.fr>.
No error message, but in the HTML page :

<option value="org.apache.tapestry.util.EnumSelectModel@767fb3">

instead of my enum value...

My java code :

    public EnumSelectModel getReportModel() {
        return new EnumSelectModel(Report.class, _resources.getMessages());
    }




Michael Courcy a écrit :
> Do you have error messages ?
>
> TNO a écrit :
>> Hi,
>>
>> I want to create a very simple select list from an enum.
>>
>> <t:select model="${reportModel}" value="${report}"/>
>>
>> But in a select component, the model (org.apache.tapestry.SelectModel)
>> is required, I try to use EnumSelectModel but it did not work...
>> I can't have my enum list...
>>
>> please help, thanks
>>
>> Tom
>>
>>
>>
>> ---
>> Antivirus avast! : message Sortant sain.
>> Base de donnees virale (VPS) : 071114-0, 14/11/2007
>> Analyse le : 15/11/2007 16:50:02
>> avast! - copyright (c) 1988-2007 ALWIL Software.
>> http://www.avast.com
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>   
>
>


---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 071114-0, 14/11/2007
Analyse le : 15/11/2007 17:47:28
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Simple question about select and enum

Posted by Michael Courcy <mi...@gmail.com>.
Do you have error messages ?

TNO a écrit :
> Hi,
>
> I want to create a very simple select list from an enum.
>
> <t:select model="${reportModel}" value="${report}"/>
>
> But in a select component, the model (org.apache.tapestry.SelectModel)
> is required, I try to use EnumSelectModel but it did not work...
> I can't have my enum list...
>
> please help, thanks
>
> Tom
>
>
>
> ---
> Antivirus avast! : message Sortant sain.
> Base de donnees virale (VPS) : 071114-0, 14/11/2007
> Analyse le : 15/11/2007 16:50:02
> avast! - copyright (c) 1988-2007 ALWIL Software.
> http://www.avast.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   


-- 
Michael Courcy
http://courcy.blogspot.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org