Hello,
in my app there are a lot of textfields and selectboxes.
User can select and fill in some values, then he can send this selection to
a PHP server . The values will be stored in a database later.

In the moment I try this:
Make a controller:

 var modelSkeleton = {copies: "1", printoption: null, deadline: "", jobtype:
"", hidden: "myHidden"};
  var model = qx.data.marshal.Json.createModel(modelSkeleton);
  // create the controller
  var controller = new qx.data.controller.Object(model);
 // connect the copies
controller.addTarget(txtCopies, "value", "copies", true);
 // connect the deadline
 controller.addTarget(txtDeadline, "value", "deadline", true);
 // connect the select box Printoption
 controller.addTarget(selectBoxPrintOption, "modelSelection[0]",
"printoption", true);
  //connect slectbox JobType
 controller.addTarget(selectBoxJobType, "modelSelection[0]", "jobtype",
true);
....

      btnSend.addListener("execute", function() {
                  alert("You are sending: " + qx.util.Serializer.toJson(model));
                  this.printingData(qx.util.Serializer.toUriParameter(model));
 
      }, this);


In the function printingData I make a remote request:

        printingData : function(uriparam){
          var UserID = qx.bom.Cookie.get("C_UserID");
          var req = new qx.io.remote.Request(
         "http://localhost/PA/myapp/backend/printing.php";, 
          "GET", 
          "application/json");
          req.addListener("completed", function(e) {
                  try
                  {
                         var content = e.getContent();
                         if (content.length > 0) {
                                        //this.tableModel.setData(content);
                                        //tableModel.setData(content);
                         }//if
                  }
                  catch (e)
                  {
                                  alert("Fehler beim senden der Form Daten: " + 
e.toString());
                  }   
          }, this);
          req.setParameter("UserID", UserID);
          req.setParameter("URIPARAM", uriparam);
          req.send();
        },

This works in the moment. All elements will be transfered with the URI as
parameters.

But is this a good solution?
What is when I have much more SelectBox and textfields and other parameters?
The URL will be very long?

Any suggestions?

thanks a lot?

best regards
Hansjoerg


--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Howto-send-many-Form-elements-to-PHP-backend-tp6676233p6676233.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to