Unless you have a converter, you're not setting the value to null,
you're setting the value to empty string. There's a variety of ways
to handle it. One way might be to use itemValue="#{someBean.null}"
and implement public Object someBean.getNull() { return null; }
Another way is to use a converter and convert empty string into null
values, or you can use a special placeholder value instead of empty
string.
On 6/18/08, Marcelo Romulo Fernandes <[EMAIL PROTECTED]> wrote:
>
> Hi everyone,
>
> I used the following code to set "null" to the Boolean property
> filterCancelledStatus of userListPageBean. It worked well when i was working
> with myfaces 1.1, but when i migrate to myfaces 1.2, the value is set to
> False, why? The same problem occurs with Long properties because with
> myfaces 1.2 the value 0 is set.
>
> <h:selectOneMenu id="filterCancelledStatus"
> styleClass="base-h-selectOneMenu"
> value="#{userListPageBean.filterCancelledStatus}">
> <f:selectItem itemValue=""
> itemLabel="#{msg['label.all']}"/>
> <f:selectItems
> value="#{userPageBean.cancelledStatusSelectItemList}" />
> </h:selectOneMenu>
>
> Any suggestions?
> Thanks in advance.
>
> ´s marcelo
>
>