Rafael,

Rene is right -
in my case JSF bean has a property with type long,
and when I was creating the values for <f:selectItems/> tag I added manually
SelectItem(0, "All") to a collection,

must be SelectItem((long)0,"All");

not sure what to do  in your case,

but I suggest to populate selectBox also by <f:selectItems/> tag




2009/7/21 Anton Gavazuk <[email protected]>

> Hi Rafael,
>
> the same happens in my project, I have slight difference - I'm populating
> selectBox by <f:selectItems/> tag
> and have a strange situation - see the snippet below
>
> <select id="fm_finance_search:in_fintype" size="1" name="
> fm_finance_search:in_fintype"> <option selected="selected" value="0">All</
> option>
> <option value="7">Bill</option>
> <option value="10">Cash deposit</option>
> <option value="11">Cash withdrawal</option>
> <option value="12">Other</option>
> <option value="8">Salary payment</option>
> <option value="9">Upfront payment</option>
> </select>
>
> and when I select first "All" option jsf throws "Value is not valid",
> otherwise it works fine. Really confusing case...
>
>
> 2009/7/21 SANTINI, Rafael <[email protected]>
>
> Hi,
>>
>> I can't figure out why the following code results in "value is not a valid
>> option":
>>
>> <h:messages/>
>> <h:form>
>>  <t:selectOneMenu value="#{bean.opcao}" id="opcao">
>>   <f:selectItem itemLabel="Opção 1" itemValue="1"/>
>>   <f:selectItem itemLabel="Opção 2" itemValue="2"/>
>>   <f:selectItem itemLabel="Opção 3" itemValue="3"/>
>>  </t:selectOneMenu>
>>  <h:message for="opcao"/>
>>  <h:commandButton value="OK"/>
>> </h:form>
>>
>> public class Bean {
>>
>>   private Integer opcao;
>>
>>   public Integer getOpcao() {
>>       return opcao;
>>   }
>>
>>   public void setOpcao(Integer opcao) {
>>       this.opcao = opcao;
>>   }
>>
>> }
>>
>> Thanks,
>>
>> Rafael Santini
>>
>>
>>
>>
>

Reply via email to