Strange tr:selectBooleanCheckbox behaviour

View: New views
2 Messages — Rating Filter:   Alert me  

Strange tr:selectBooleanCheckbox behaviour

by Clogs :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

I hope someone has an idea about this one...

I have a table (tr:table) in which one of the columns contains a tr:selectBooleanCheckbox.

       <tr:column headerText="#{msg['web.message.label.loc.select']}">
            <tr:selectBooleanCheckbox value="#{bean.selected}" />
       </tr:column>

When I load the page, the table gets filled with the data from the database, which means (in this case) that the checkbox is checked on each row. This is shown correctly.

I now de-select one of the checkboxes and then go back to the previous page (by using an application button). If I then go forward again (also through a button within the application) I reload the table and the data model behind the table shows the 'selected' indicators as both being true (since that is the default when the table is loaded). However, rendering of the page does not pick this up: the checkbox I de-selected before going back to the previous page remains de-selected. When I debug the application, the getter of the boolean (isSelected() or getSelected(), both don't work) does not get invoked.
The h:selectBooleanCheckbox exhibits the same behaviour.

Any ideas?

regards,

Willem Kunkels

Re: Strange tr:selectBooleanCheckbox behaviour

by Andrew Robinson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This should be asked on the users@ mailing list.

What you are seeing is the correct behavior. When a JSF view is
rendered that has input controls, those controls render their local
values and submitted values before the model values. If you change the
model values, you also need to clear all of the local & submitted
values from the input components on the page. Only then will the
components render the value from the model again.

-Andrew

On Tue, Nov 3, 2009 at 6:43 AM, Willem Kunkels
<Willem.Kunkels@...> wrote:

>
> Hi,
>
> I hope someone has an idea about this one...
>
> I have a table (tr:table) in which one of the columns contains a
> tr:selectBooleanCheckbox.
>
>        <tr:column headerText="#{msg['web.message.label.loc.select']}">
>             <tr:selectBooleanCheckbox value="#{bean.selected}" />
>        </tr:column>
>
> When I load the page, the table gets filled with the data from the database,
> which means (in this case) that the checkbox is checked on each row. This is
> shown correctly.
>
> I now de-select one of the checkboxes and then go back to the previous page
> (by using an application button). If I then go forward again (also through a
> button within the application) I reload the table and the data model behind
> the table shows the 'selected' indicators as both being true (since that is
> the default when the table is loaded). However, rendering of the page does
> not pick this up: the checkbox I de-selected before going back to the
> previous page remains de-selected. When I debug the application, the getter
> of the boolean (isSelected() or getSelected(), both don't work) does not get
> invoked.
> The h:selectBooleanCheckbox exhibits the same behaviour.
>
> Any ideas?
>
> regards,
>
> Willem Kunkels
>