myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjzhoufy <zjzho...@163.com>
Subject [Tobago] How could I set up the default value of a tx:selectOneChoice tag
Date Sat, 17 Sep 2011 10:39:13 GMT
Hi,
 
How could I set up the default value of a drop down list (tx:selectOneChoice) to the initialized
value in the object?
 
Here is the code in my jsp file content:
     <tx:selectOneChoice id="mtn_basic_role_select" label="Please select a role"
      value="#{clgBasicMaintain.clg.role}" converter="clgRoleConverter">
              <f:selectItems value="#{listservice.roleList}"  id="roleList_item" />
     </tx:selectOneChoice>
------------------------------------------
clgBasicMaintain.clg.role with type ColleagueRole, and #{listservice.roleList} is a SelectItem
list with value type ColleagueRole and label is the role name.
 
clgRoleConverter could convert the role name to the ColleagueRole object.
 
Now the object clgBasicMaintain.clg already has an initialized value. But every time I run
this page, the defaule value of the drop down list is set to the first SelectItem of the list.
 
How could I set up the default value of the drop down list to the initialized value please?
 
If you need any more information, please let me know.
 
Many thanks.
Regards,
Peter Zhou

--

********************************************
zjzhoufy@hotmail.com
zjzhoufy@163/126.com
zjzhoufy@gmail.com
********************************************
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message