Once again: it's not the BooleanConverter issue. In fact ANY converter dosn't work as expected, since it's just not called in component. See: http://issues.apache.org/jira/browse/MYFACES-1532

Regards,
paul

r.stranders schrieb:
Thanks for your reply. I tried the converter tag to no avail. The
BooleanConverter does indeed convert null values and empty strings to a null
Boolean (I tried it in a simple program), but when I use it in my page it
simply doesn't work. Moreover, I believe that the BooleanConverter is used
by default for Boolean attributes. Anyway, it remains a strange problem,
given the fact that BooleanConverter does work in isolation. Any other
ideas?


Andrew Robinson-5 wrote:
Sorry, I think I remember that SelectItem throws an error if the value
is null. In JSF 1.1, if you use the boolean converter, an empty string
should be converted to null (javax.faces.convert.BooleanConverter).

<h:selectOneRadio>
  <f:converter id="javax.faces.Boolean" />
  ...

Also I assume that your bean is:
public Boolean getAccountNotExpired() {}
public void setAccountNotExpired(Boolean value) {}

On 3/7/07, Andrew Robinson <[EMAIL PROTECTED]> wrote:
Guess: have you tried:

<f:selectItem itemValue="#{null}" itemLabel="#{messages['all']}" />

On 3/7/07, r.stranders <[EMAIL PROTECTED]> wrote:
Hi,

I've got the following problem. In one of my pages, I use a radiobutton
to
fill a value of a Boolean attribute. However, the radiobutton has three
states: true, false, and null. Unfortunately, I cannot get
selectOneRadio to
currectly set the 'null' value in my attribute when I select it.
Instead,
the attribute becomes 'false'. Here is a snippet from my page:

<h:outputLabel for="enabled" value="#{messages['user.accountExpired']}"
/>
                <h:selectOneRadio id="enabled"
value="#{criteria.accountNonExpired}">
                        <f:selectItem itemValue="true"
itemLabel="#{messages['user.accountNotExpired']}" />
                        <f:selectItem itemValue="false"
itemLabel="#{messages['user.accountExpired']}" />
                        <f:selectItem itemValue=""
itemLabel="#{messages['all']}" />
                </h:selectOneRadio>
<h:message errorClass="fieldError" for="enabled" />

The page is used to search for users. The radiobutton should give the
user
three options: get all users, get all expired users, and get all
non-expired
users.

I tried everything. Any ideas?
--
View this message in context:
http://www.nabble.com/Three-state-Boolean-in-selectOneRadio-tf3363241.html#a9356545
Sent from the MyFaces - Users mailing list archive at Nabble.com.




Reply via email to