Page 1 of 1

Executing service problem

Posted: Thu Mar 28, 2013 9:01 pm
by Sean Kelley

I am attempting to get a total count of records from a service query. I am having issues with my execution order and understanding things well enough to get what I need. I either get a service fail or a script fail

Within a popup I have script:
saddleCountSearch.execute({ "data" : {"where": '{"maker":"Albion"}'}});
console.log('query attempted'); //this happens
var count=data.length; //this appears to be my fail point
localStorage.setItem("total",count); //this does not happen
console.log('search count-on page'); //this does not happen

then on the data side of things I have on success of saddleCountSearch the following code:
var count2 = data.length;
console.log(count2);

I get a value for count2 which is valid but I get an error for trying to set count on popup. If I comment out the line var count... on the executing popup, the service fails and I obviously have no count2 value.

error when success is true is:
Uncaught ReferenceError: data is not defined
$.die.live.click
jQuery.event.dispatch jquery-1.8.2.js:3063
elemData.handle.eventHandle


Executing service problem

Posted: Thu Mar 28, 2013 9:35 pm
by Kateryna Grynko

Hi Sean,

Variable "data" is created by Tiggzi only in Success event.

For this codecodevar count=data.length;/code"data" variable is not defined.


Executing service problem

Posted: Thu Mar 28, 2013 9:51 pm
by Sean Kelley

that makes sense. how come when I comment the line out the error event happens?


Executing service problem

Posted: Thu Mar 28, 2013 10:05 pm
by Kateryna Grynko

The error is in the following line:codevar count=data.length; //this appears to be my fail point/code
You should comment the line this waycode//var count=data.length; //this appears to be my fail point/codeor just delete it.
Does the error still appear?


Executing service problem

Posted: Thu Mar 28, 2013 10:12 pm
by Sean Kelley

this is all I have now:
saddleCountSearch.execute({ "data" : {"where": '{"maker":"Albion"}'}});

the success event is no longer triggered


Executing service problem

Posted: Fri Mar 29, 2013 10:39 am
by Maryna Brodina

Please share your app with a href="mailto:support@tiggzi.com" rel="nofollow"support@tiggzi.com/a


Executing service problem

Posted: Fri Mar 29, 2013 12:42 pm
by Sean Kelley

Thanks for your help- I decided to move the execution of the service from the popup to the originating page and that worked. I do not know if that was the problem or if I had another problem that resolved itself through fresher eyes.


Executing service problem

Posted: Fri Mar 29, 2013 12:46 pm
by Maryna Brodina

Ok, glad it's working now.