Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
sample scenario:
public class Person
{
...
private Character gender; //I chose Character to compare possibilities
//+ getter and setter methods
}
-> within tr:selectOneRadio the following two selectItems work very well:
<tr:selectItem label="#
<tr:selectItem label="#{messages.male}" value="m" .../>
("f" and "m" is important for the comparison)
the example above also works with a java 5 enum with one exception - preselected values:
e.g.:
public enum Gender
{
female, male
}
->
public class Person
{
...
private Gender gender;
//+ getter and setter methods
}
in comparison to the first example it would be logical to use the following possibility (with the enum version of this example):
<tr:selectItem label="#{messages.female}
" value="female" .../>
<tr:selectItem label="#
this version of the example works well with the exception of the preselected/default value
(e.g. if the page is redisplayed and should provide the previous entered value(s) or a simple default selection which is not reasonable for this gender example...)
—
at the moment the following workaround is possible:
<tr:selectItem label="#{messages.female}" value="#{pageBean.female}" ..."/>
<tr:selectItem label="#{messages.male}
" value="#
{pageBean.male}" ..."/>
within pageBean:
public Gender getFemale()
{
return Gender.female;
}
public Gender getMale()
{
return Gender.male;
}
Attachments
Attachments
Issue Links
- is blocked by
-
TRINIDAD-812 missing optgroup support for tr:selectOneListbox and tr:selectManyListbox
- Closed