Unfortunately this didn't help.

But this helps:

          <tr:selectItem label="2008" value="2008" />
          <tr:selectItem label="2009" value="2009" />
          <tr:selectItem label="2010" value="2010" />
          <tr:selectItem label="2011" value="2011" />


Rafa Pérez wrote:
> 
> Try changing
> 
>>        <tr:forEach var="year" begin="#0" end="10">
>>                <tr:selectItem label="#{year}" value="#{year}" />
>>        </tr:forEach>
> 
> for:
> 
> <f:selectItems value="#{bean.selectItemArray}"  />
> 
> And in the bean add (with its getter and setter):
> 
> private SelectItem[] selectItemArray;
> 
> 
> Then, to load the array you just have to do:
> 
> selectItemArray = new SelectItemArray[1];
> 
> selectItemArray[0] = new SelectItem(year, year.toString());
> 
> 
> HTH
> 

-- 
View this message in context: 
http://www.nabble.com/default-value-in-tr%3AselectOneChoice-tp19393693p19990967.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to