Hi Mike,

thank you for sharing. I will talk to Martin, but not until on Monday, 
he has currently vacation.

Cheers,
Chris


mshillin schrieb:
> The Radio Buttons in 0.8.3pre do not allow you set a user defined value. 
> getValue() returns either true/false.  setValue(userVal) throws an error if
> userVal is not a boolean.
>
> Assertion error! Invalid incoming value for property 'value' of class
> 'qx.ui.form.RadioButton': Expected value to be a boolean but found XXXX
>
> The new selection API makes them much harder to use and a lot less
> intuitive.
>
> The Radiobutton Demos show using the Label for a value, but this is less
> than optimal for translated applications.
>
> Given the following:
>
> var bnt1 =  new qx.ui.form.RadioButton(this.tr("Green"));
> var bnt2 =  new qx.ui.form.RadioButton(this.tr("Blue"));
>
> var colorGroup = new qx.ui.form.RadioGroup(btn1, btn2);
>
> this.colorGroup.addListener("changeSelection", this.onChangeColor, this);
> ...
> onChangeType : function(event) {
>   var value = event.getData()[0].getLabel();
>   if (value == this.tr("Green")) {
>    //This does not work - probably because it is comparing localized  string
> objects - not string characters
>    alert("You are looking at the grass");
>   }
>   else {
>
>    alert("You are looking at the sky");
>   }
>
> ++++
>
> I can do the following
>
> onChangeType : function(event) {
>   var value = event.getData()[0].getLabel().toString();
>   if (value == this.tr("Green").toString()) {
>    alert("You are looking at the grass");
>   }
>   else {
>
>    alert("You are looking at the sky");
>   }
>
> ++++
>
> But it would be much simpler and more intuitive to allow user defined
> values.
>
> var bnt1 =  new qx.ui.form.RadioButton(this.tr("Green"));
> btn1.setUserValue("green");
>
> var bnt2 =  new qx.ui.form.RadioButton(this.tr("Blue"));
> btn2.setUserValue("blue");
>
> var colorGroup = new qx.ui.form.RadioGroup(btn1, btn2);
>
> this.colorGroup.addListener("changeSelection", this.onChangeColor, this);
> ...
> onChangeType : function(event) {
>   var value = event.getData()[0].getUserValue();
>   if (value == "green")) {
>    alert("You are looking at the grass");
>   }
>   else {
>
>    alert("You are looking at the sky");
>   }
>
>
> The previous approach (pre 0.8.3) was much more intuitive where the
> RadioButton had a label and a  user defined value.
>
> Mike
>
>   


-- 
Christian Schmidt
Software Engineer
Core Development :: Web Technologies

1&1 Internet AG
Ernst-Frey-Str. 9
76135 Karlsruhe, Germany
http://www.1und1.de 

Amtsgericht Montabaur / HRB 6484
                                                        
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver 
Mauss, Jan Oetjen

Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to