gonadn
Posts: 0
Joined: Wed Apr 03, 2013 11:03 pm

Building a Clickable List App with HTML5 Database Storage

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

gonadn
Posts: 0
Joined: Wed Apr 03, 2013 11:03 pm

Building a Clickable List App with HTML5 Database Storage

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....?!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Building a Clickable List App with HTML5 Database Storage

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).

gonadn
Posts: 0
Joined: Wed Apr 03, 2013 11:03 pm

Building a Clickable List App with HTML5 Database Storage

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
});
}
},
});

gonadn
Posts: 0
Joined: Wed Apr 03, 2013 11:03 pm

Building a Clickable List App with HTML5 Database Storage

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Building a Clickable List App with HTML5 Database Storage

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

gonadn
Posts: 0
Joined: Wed Apr 03, 2013 11:03 pm

Building a Clickable List App with HTML5 Database Storage

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Building a Clickable List App with HTML5 Database Storage

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.

gonadn
Posts: 0
Joined: Wed Apr 03, 2013 11:03 pm

Building a Clickable List App with HTML5 Database Storage

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

Does it look correct or?

gonadn
Posts: 0
Joined: Wed Apr 03, 2013 11:03 pm

Building a Clickable List App with HTML5 Database Storage

service url is define like this : /PartneGymPriser/object_id

Return to “Issues”