You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by amebaliu <am...@yahoo.com> on 2008/05/17 14:07:22 UTC
Question about select component
Hi all, I have a question about select componenet,somehow, my options starts
from null, then userone, then usertwo, rahter than start from userone.. I
really can not find where is the error.. Hope somebody can help me, thanks
a lot
Here is my code
select t:type="select" t:model="users" t:value="user"/>
@Inject
private Messages messages;
public SelectModel getUsers(){
return new EnumSelectModel(Users.class,messages);
}
@Persist
private Users user;
public Users getUser(){
return this.user;
}
public void setUser(Users user){
this.user = user;
}
package test.todolist.model;
public enum Users {
USERONE,USERTWO,USERTHREE
}
--
View this message in context: http://www.nabble.com/Question-about-select-component-tp17291010p17291010.html
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: Question about select component
Posted by amebaliu <am...@yahoo.com>.
Hi Serge, thanks a lot, the problem is solved. thank you
SergeEby wrote:
>
> Hey,
>
> Assuming you are using version 5.0.11, you can add: blankoption="never" to
> the component definition.
>
> See details here:
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Select.html
>
> /Serge
>
>
> amebaliu wrote:
>>
>> Hi all, I have a question about select componenet,somehow, my options
>> starts from null, then userone, then usertwo, rahter than start from
>> userone.. I really can not find where is the error.. Hope somebody can
>> help me, thanks a lot
>> Here is my code
>> select t:type="select" t:model="users" t:value="user"/>
>>
>> @Inject
>> private Messages messages;
>> public SelectModel getUsers(){
>> return new EnumSelectModel(Users.class,messages);
>> }
>>
>> @Persist
>> private Users user;
>> public Users getUser(){
>> return this.user;
>> }
>> public void setUser(Users user){
>> this.user = user;
>> }
>> package test.todolist.model;
>>
>> public enum Users {
>> USERONE,USERTWO,USERTHREE
>> }
>>
>
>
--
View this message in context: http://www.nabble.com/Question-about-select-component-tp17291010p17291637.html
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: Question about select component
Posted by SergeEby <sd...@hotmail.com>.
Hey,
Assuming you are using version 5.0.11, you can add: blankoption="never" to
the component definition.
See details here:
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Select.html
/Serge
amebaliu wrote:
>
> Hi all, I have a question about select componenet,somehow, my options
> starts from null, then userone, then usertwo, rahter than start from
> userone.. I really can not find where is the error.. Hope somebody can
> help me, thanks a lot
> Here is my code
> select t:type="select" t:model="users" t:value="user"/>
>
> @Inject
> private Messages messages;
> public SelectModel getUsers(){
> return new EnumSelectModel(Users.class,messages);
> }
>
> @Persist
> private Users user;
> public Users getUser(){
> return this.user;
> }
> public void setUser(Users user){
> this.user = user;
> }
> package test.todolist.model;
>
> public enum Users {
> USERONE,USERTWO,USERTHREE
> }
>
--
View this message in context: http://www.nabble.com/Question-about-select-component-tp17291010p17291503.html
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