Form controller and DateField

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Form controller and DateField

rsantiagopaz

I have this little example. In target2model function, which is the paramet1's data type?
I can't do any data model transformation, because I can't detect the correct data type.
I was trying with any qooxdoo functions(qx.dev.Debug.*, qx.util.Serializer.*, etc) or others tricks but I cant detect.
I originally believed is Date javascript date type, but is not.
Thanks.


var doc = this.getRoot();
               
var form = new qx.ui.form.Form();

var txtName = new qx.ui.form.TextField("");
form.add(txtName, "Name", null, "name");
var txtDate1 = new qx.ui.form.DateField();
txtDate1.setValue(new Date());
form.add(txtDate1, "Date", null, "date1");

var formController = new qx.data.controller.Form(null, form);
formController.addBindingOptions("date1",
        {converter: function(paramet1) {
                //model2target function

        }},
        {converter: function(paramet1) {
                //target2model function

        }}
);

doc.add(new qx.ui.form.renderer.Double(form), {left: 20, top: 20});
Reply | Threaded
Open this post in threaded view
|

Re: Form controller and DateField

rsantiagopaz
this is the correct example:

var doc = this.getRoot();
               
var form = new qx.ui.form.Form();

var txtName = new qx.ui.form.TextField("");
form.add(txtName, "Name", null, "name");
var txtDate1 = new qx.ui.form.DateField();
txtDate1.setValue(new Date());
form.add(txtDate1, "Date", null, "date1");

var formController = new qx.data.controller.Form(null, form);
formController.addBindingOptions("date1",
        {converter: function(paramet1) {
                //model2target function

        }},
        {converter: function(paramet1) {
                //target2model function

        }}
);
formController.createModel();

doc.add(new qx.ui.form.renderer.Double(form), {left: 20, top: 20});
Reply | Threaded
Open this post in threaded view
|

Re: Form controller and DateField

rsantiagopaz
In reply to this post by rsantiagopaz
Forget this. Please sorry. I detected my mistake.