If that really is your code, then it won't matter what you do before the
_callRpcSync method since you are still passing in the getModel() param,
not the one you are trying to create.
I assume that getModel() returns a JSON object. If so, try this code:
_handleSubmit : function(e)
{
var item = e.getData();
var url = "http://myUrl_blahblah";
var service = this._getService(item);
var model = item.getModel();
model["crudeMode"] = "new";
model["crudeName"] = "myName";
this._callRpcSync(service, url, model); // you must
change this line!!!
}
Hope this helps.
Jim
On Tue, Oct 9, 2012 at 7:46 PM, jwhitten <john_whit...@yahoo.com> wrote:
>
>
> Hello,
>
> Sorry for posting this again. But I really need some help please! I have
> been banging my head on this for a couple of days now, and I'm completely
> stuck!!!
>
>
> I have set up a form and rpc object and have it all working splendidly.
> When
> the Save button is pressed on the form, it calls "_handleSubmit" which sets
> up the RPC params and then calls the RPC function. The "getService"
> function
> simply returns the name of the "service" I want to call on the back-end.
> (Yes, I know I'm using RPC _sync_... :-) Here is a brief snippet from my
> code. (I don't think an entire app is necessary to understand my question.
> If it is, I'll cruft something up and post it again.)
>
>
> _callRpcSync : function(service, url, params) //
> synchronous
> model
> {
> var rpc = new qx.io.remote.Rpc(url, service);
>
> try {
> var results = rpc.callSync(service,
> qx.util.Serializer.toUriParameter(params));
> return results;
> }
> catch (exc) {
>
> qx.core.Init.getApplication().debug("RPC-SYNC Exception: " + exc);
> }
> },
>
> _handleSubmit : function(e)
> {
> var item = e.getData();
> var url = "http://myUrl_blahblah";
> var service = this._getService(item);
> this._callRpcSync(service, url, item.getModel());
> }
>
>
> So, the "item.getModel()" part has the data from the form elements in it.
> Like I said before, this works, no issues. What I want to do that I'm
> having
> problems with, is I want to INJECT a couple of additional items into the
> model just before I send it off to the RPC call. Something like this:
>
> _handleSubmit : function(e)
> {
> var item = e.getData();
> var url = "http://myUrl_blahblah";
> var service = this._getService(item);
> var model = item.getModel();
> ...SOMEHOW_ADD( { crudMode: "new", crudName:
> "myName" } )_TO_MODEL...
> this._callRpcSync(service, url, item.getModel());
> }
>
>
> I've tried doing this just about every way I can think of. I've combed the
> Internet for hours and hours and read every snippet I can find on the
> Qooxdoo list that even remotely seems relevant, and nothing I try seems to
> work. I can create an array object, merge it with the model and get the NEW
> items but not the model items, even though they seemed to have merged. I
> can
> merge the MODEL items with the new items and get the MODEL items, but not
> the new items. I've tried half a dozen different things-- this seems like
> it
> should be such a SIMPLE thing to do... but nothing works!
>
> Can somebody help me please?
>
> THANKS!!!
>
> John
>
>
>
> --
> View this message in context:
> http://qooxdoo.678.n2.nabble.com/Need-help-with-Models-please-tp7581630.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel