Page 1 of 4

Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 9:11 pm
by gonadn

Hi

Iam following this tutorial : http://docs.tiggzi.com/tutorials/buil...

In my case i dont have any XML rest service to call, i want to get my data from database. And in the tutorial you have to create 2 rest services for getting data, and i have created 2 services, one for listing actiivities on first page and the second service to list out details of selected activity, se pic below:
Image

In the tutorial you have to create REST service (to get all routes), in my case is get all activities. And as you can see iam listing out all my activities with the _id.

And when i click one activitie, dosent matter wich one, i only get the first record of the json data or from the database, se pic below:
Image

I have done the step where i have to set up navigation to details page and set local storage variable as described in tutorial. So iam stucked here....

regards
gonadn


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 9:14 pm
by gonadn

And i have also done the step where i have to add the details service to the page..., i think it is something wrong with the setup of service maybe....?!


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 9:15 pm
by maxkatz

Debug the service on the second page, to make sure it's invoked with the right record id. You should use Chrome Dev. Tools (or Firebug).


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 10:01 pm
by gonadn

Oki, i will try to see if can find out by debuging, iam not so god in javascript and debuging from firebug, i have used firebug before, but iam still learning. Iam getting error when i test my service by _id of activity, se pic:
Image

why can i not do query by _id?
But if i put X-Tiggzi-Database-Id and test, then i get all records in json format.

And in my click event i can se that actid is defined but maybe not passed to detail page?
$('#j_82 [name="mobilelistitem1_65"]').die().live({
click: function() {
if (!$(this).attr('disabled')) {
setVar_('AktID', 'j_87', 'text', '', this);
Tiggr.navigateTo('PrisDetaljer', {
transition: 'flip',
reverse: false
});
}
},
});


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 10:06 pm
by gonadn

Can i share my project with you so you can take look at how i have done?


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 10:11 pm
by maxkatz

You are missing the database id, test or running the app won't work without it.


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 10:13 pm
by gonadn

oki, so if i put database id back, and in second field put activity id then i shoud only se that activity as json and not all?


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 10:17 pm
by maxkatz

It depends how the service URL is defined. Do you have 'id' at the end of the URL? If yes, then you should get just one record.


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 10:27 pm
by gonadn

Here is how i have done binding to details page:
Image

Does it look correct or?


Building a Clickable List App with HTML5 Database Storage

Posted: Sat Apr 06, 2013 10:30 pm
by gonadn

service url is define like this : /PartneGymPriser/object_id