You can't have it both ways.

If you bind the value to the backing bean, then the value always
reflects what's in the backing bean.

You can bind it to a different backing bean property.  Perhaps one
that adjusts the value returned by the getter for the first time the
page is displayed or otherwise delegates to your original
setter/getter.

You could try some kind of trickery and set the
processedSelectBooleanCheckbox component's submitted value to true via
java code on the first submit.   There's a lot of unknowns in how
you'd accomplish this.

Realistically, though, I wouldn't be trying to change the
processedSelectBooleanCheckbox behavior.   Instead, I'd probably
change the behavior of how your "value is displayed in a data table"
and accurately track the value of the checkbox in the property you've
bound it to.

On 3/14/06, Michael Heinen <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi all,
>
>
>
> I have a strange problem with a selectBooleanCheckbox and preselection.
>
>
>
> When I use the following statement
>
>             <h:selectBooleanCheckbox id="processed"
> value="#{DynaAnnoControllerBean.document.datafield['processed']}"/>
>
> then I always receive the right value after page submission in my
> BackingBean and everything is working fine.
>
>
>
> Now I want that the checkbox is always set to checked as default,
> independently on the BackingBean value.
>
> So I tried the following line:
>
>             <h:selectBooleanCheckbox id="processed" value="true" />
>
>
>
> The problem now is that the value in the BackingBean is not updateded after
> page submission.
>
>
>
>
> The strange thing is that the generated html for both tags is the same.
>
>             <input type="checkbox" name="docform:processed"
> id="docform:processed" checked="checked" value="true" />
>
>
>
> So what's going wrong here?
>
> Why is the model not updated?
>
>
>
> I can't set the model value to true before I display the page because the
> existing value is also displayed in a data table.
>
>
>
> Michael
>
>

Reply via email to