Hi,
we are aware of exactly the problem you describe and we have a solution
already.
We removed the name and "original" value property because we are not in
html. That was the main reason because a string representation for a simple
radio button is in some cases not enough.
But we added a model property which you can use instead of your value. This
can take no matter what data type you supply, even a string.
Please take a look at the following former mail on the list to see how the
binding works:
http://n2.nabble.com/RadioButtonGroup-and-ModelSelection-td3573156.html#a3573156
As for serialization, take a look at the documentation of the new form
layer:
http://qooxdoo.org/documentation/0.8/ui_form_handling2
The name can be added to the form itself and can be used for serialization.
Take also a look at the following demo, shoing you how you could take
advantage of the new form components at all:
http://demo.qooxdoo.org/devel/demobrowser/#data~FormController.html
But in any case, you can still use userdata to simulate the things you like:
http://demo.qooxdoo.org/0.8.3/apiviewer/#qx.core.Object~setUserData
Regards,
Martin
A.Yerenkow wrote:
>
> Hello all!
> I have a great problems with new qooxdoo.
> For example:
> in 082, RadioButton had a string value. This code works fine:
> var manager = new
> qx.ui.form.RadioButton(application.tr("Manager"));
> manager.setValue("Manager");
> var mgr = new qx.ui.form.RadioGroup;
> mgr.add(manager, client, dealer);
> mgr.bind("changeValue", application.loginData, "mode");
>
> So, I can put a free form string to radio buttons, group them to
> RadioGroup, and bind them to a string property. And this string not
> required to be the same as label - this is important, and can be used
> for translations.
>
> In 083, RadioButton have no string value, only boolean value -- why????
> In html terms, how do I suppose build a query, if I don't know what
> exactly this radio is, "true/false" info isn't sufficient.
> More, I couldn't get same behaviour easily with binding in 083.
> I tried such way:
> var manager = new
> qx.ui.form.RadioButton(application.tr("Manager"));
> manager.setUserData("v", "Manager");
> var mgr = new qx.ui.form.RadioGroup;
> .....
> alert(manager);
> var options = {
> converter:function(value)
> {
> alert(value);
> return value.getUserData("v");
> };
> ......
> mgr.bind("changeSelection", application.loginData, "mode",
> options);
>
> But this not working.
> However, both alert(manager); and alert(value); produces same
> "qx.ui.form.RadioButton[6y]".
> But, from experiments:
> value != manager,
> value have no methods "getUserData", "toHashCode" etc.
>
> I could get it's all working only with such bad code:
>
> var options = {
> converter:function(value)
> {
> if("" + value == "" + manager)
> {
> return "Manager";
> }
> if("" + value == "" + client)
> {
> return "Client";
> }
> if("" + value == "" + dealer)
> {
> return "Dealer";
> }
> }
> };
>
>
> I looked into new Form API, I see that mixin IFormElement is deprecated,
> and all elements have now setName/getName - deprecated.
> Can someone point me, what except Name can be used to build forms, like
> this:
> "Please enter your name": textLabel, name: textfield;
> "Please enter your password": textLabel, password : textfield;
>
> and from this code form a query, like this:
> "name=enteredName&password=enteredPassword"
> NOT using labels, but names of fields.
>
> I have own FormBuilder, and I had to make this queries, to act with
> server, and I totally confused why them are dropped.
> Yes, I saw Form examples, there using something like this:
>
> var userName =new qx.ui.form.TextField();
> userName.setRequired(true);
> form.add(userName,"Name");
>
> But here's no "name" of userName field, only Label?...
>
>
>
>
>
>
>
>
>
>
> --
> Best Regards
> Alexander Yerenkow,
> Generalissimo of UCT
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register
> now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
--
View this message in context:
http://n2.nabble.com/Problems-with-new-qooxdoo-tp3647651p3648228.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel