If I were to create that component, I probably would not extend from
CheckBox as both the model is semantically different and the rendering
is done a different way. Instead, I would extend FormComponent
directly. I also would not choose for a model that has
true/false/null, which would imo be no less than a hack.

I think I would go for having a model with values none/all/some (enum)
to represent what you're actually modelling, and I'd use an element
with three images that when clicked uses Javascript to do an ajax call
(if you can use ajax) and replaces the image with another.

Eelco

On 8/31/06, Alex Objelean <[EMAIL PROTECTED]> wrote:
>
> I am glad that so many people start to debate in this topic. First of all I
> need to explain my usecase:
>
> it is indeed about a tree... I have a tree containing Roles (hierarchical
> structure). There is a screen in which the user must select the Roles which
> he want to assign to a user.
>    The logic is simple: if you check a node - the checked Role is added to
> the list of selected Roles, otherwise it is removed from the list. At the
> same time, if you check a child - all the ancestors changes theirs state to
> intermediate (if their current state is unchecked, otherwise it doesn't
> change it's state). The intermediate state has the same meaning as unchecked
> state (its only purpose is to visually inform user about the implicit Roles
> are assigned to the list of selected Roles).
>    This kind of usecase is not singular. I am sure it would be very usefull
> in many more situations, depending on applications needs.
>    Why I thought it would be a good ideea to extend the Checkbox
> FormComponent, is because it has almost the same functionality excepting the
> existence of the intermediate state. The model object in this case should be
> a Boolean object, holding the following values : [null, true, false] (the
> same ideea was posted by someone earlier)...
>    Another problem which must be taken in consideration is if the change of
> state of this component should cause the form submition or not (see the Igor
> and Korbinian Bachl posts)... The way I thought to use it in my use case was
> pro submiting the form & updating the whole tree, but Igor is right - this
> involves a lot of data being sent to the server, which for a large tree
> structure can become unacceptable... I think, there can be different
> approaches (each having its pros and cons)... Anyway, if you have any
> thougths regarding the way this component can be implemented - they are
> welcome and thank you all for your posts!
>
>
>
>
>
>
> Eelco Hillenius wrote:
> >
> > That's an interesting Widget! How would it work on the server side
> > though... what kind of model would it need.
> >
> > I'd be interested to hear about how you plan to use it. It seems this
> > is a component you'd always use with a tree, correct? If so it would
> > just be a matter of letting the tree render the proper node images.
> >
> > Eelco
> >
> >
> >> Maybe I was not clear enough in my specification. If I would not say that
> >> I
> >> need a tri-state checkbox, but a formComponent which looks like checkbox
> >> (see here:
> >> http://www.indigorose.com/webhelp/vp20/Program_Reference/Misc/Tri-state_Checkbox.htm)
> >> would it make sense? At the end, it is a component like any other
> >> component
> >> and it has nothing to do with the w3c.org specification...
> >
> > -------------------------------------------------------------------------
> > 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
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Tri-state-checkbox-tf2188974.html#a6074389
> Sent from the Wicket - User forum at Nabble.com.
>
>
> -------------------------------------------------------------------------
> 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
> Wicket-user@lists.sourceforge.net
> 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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to