Yes, but what I need is the checkbox pre-set checked or not checked
according to  direction, I would like to have the HTML checkbox at the
form checked if the property is true, and the HTML checkbox unchecked
if the preperty is false.

Which, should be same as having HTML template like

<input type=checkbox <span wicket:id="property_checked"></span>
wicket:id="checkbox">

For java code

Foo foo = new Foo();
add(new CheckBox("checkbox", new PropertyModel(foo, "toBeOrNotToBe"));
add(new Label("property_checked"), foo.toBeOrNotToBe ? "checked":"");

However, you know, that is not working...

On 11/9/06, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> public class Foo {
>     public boolean toBeOrNotToBe = true;
> }
>
> Foo foo = new Foo();
> add(new CheckBox("checkbox", new PropertyModel(foo, "toBeOrNotToBe"));
>
> So, you don't have to set anything... the checkbox is checked, and
> when unchecked, the toBeOrNotToBe property of Foo will be set to
> false.
>
> Martijn
>
> On 11/9/06, Carfield Yim <[EMAIL PROTECTED]> wrote:
> > Can I set checkbox to be checked if the related java bean property is true?
> >
> > -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job 
> > easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
> --
> <a href="http://www.thebeststuffintheworld.com/vote_for/wicket";>Vote</a>
> for <a href="http://www.thebeststuffintheworld.com/stuff/wicket";>Wicket</a>
> at the <a href="http://www.thebeststuffintheworld.com/";>Best Stuff in
> the World!</a>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to