On 15.09.2009 14:00, MartinWittemann wrote:
> 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
>
>
Thanks Martin, but this not all what I have here.
1. I tried to set as in examples:
manager.setModel("Manager");
client.setModel("Client");
dealer.setModel("Dealer");
var mgr = new qx.ui.form.RadioGroup;
mgr.add(manager, client, dealer);
...
var model = qx.data.marshal.Json.createModel({login:"",
password:"", mode:""});
var controller = new qx.data.controller.Object(model);
controller.addTarget(field1, "value", "login", false);
controller.addTarget(field2, "value", "password", false);
controller.addTarget(mgr, "value", "mode", false);
But I have only "mode=true" after that, not informative :(
I understand that value of RadioButton should be "true" or "false". But
what the sense in "value" of RadioGroup? It's always "true" no matter
what I select.
Please, explain me this point :)
2. I changed RadioGroup for SelectBox;
controller.addTarget(select, "value", "mode", true);
provide me with localized string;
controller.addTarget(select, "selection", "mode", true);
provide me with ListItem object;
controller.addTarget(select, "selection.model", "mode", true);
Just not working; Why, do you create other logic than for Data Binding?
Ok, continue diggin....
>
> 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
>>
>>
>>
>
--
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