Tristate boolean

2014-11-17 Thread Lucio Crusca
Hello,

I have a sql field that is a BOOLEAN, which allows for NULL also. So it can be 
TRUE, FALSE, or NULL.

I need a component to let the user set that field to one of the three states. 
I'm thinking about using two checkboxes, one for TRUE, the other for FALSE and 
when neither is checked it means NULL. A bit of javascript would then avoid 
the both checked state.

Is there anything like that ready to use?

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Tristate boolean

2014-11-17 Thread Martin Grigorov
https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-extensions/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/form/checkboxx/CheckBoxX.java

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Nov 17, 2014 at 2:12 PM, Lucio Crusca lu...@sulweb.org wrote:

 Hello,

 I have a sql field that is a BOOLEAN, which allows for NULL also. So it
 can be
 TRUE, FALSE, or NULL.

 I need a component to let the user set that field to one of the three
 states.
 I'm thinking about using two checkboxes, one for TRUE, the other for FALSE
 and
 when neither is checked it means NULL. A bit of javascript would then avoid
 the both checked state.

 Is there anything like that ready to use?

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Tristate boolean

2014-11-17 Thread Lucio Crusca
In data lunedì 17 novembre 2014 14:22:11, Martin Grigorov ha scritto:
 https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-extensi
 ons/src/main/java/de/agilecoders/wicket/extensions/markup/html/bootstrap/for
 m/checkboxx/CheckBoxX.java

Thanks, I've tried it but I've not managed to make it work, the checkbox never 
changes state on click. Here is what I've done so far:

1. added maven dependency:

dependency
  groupIdde.agilecoders.wicket/groupId
  artifactIdwicket-bootstrap-extensions/artifactId
  version0.9.7/version
/dependency

2. added input tag to my form

input wicket:id=input type=checkbox /

3. added a CheckBoxX in java code:

form.add(new CheckBoxX(input, model.Booleanbind(rewind)));

where model is a CompoundPropertyModelMyBean and MyBean has a

  private Boolean rewind; // along with getter and setter

I have a suspect though: should I include Bootstrap myself in order to use 
CheckBoxX?



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org