Page 1 of 2

Retrieve data using clickable list

Posted: Wed Dec 11, 2013 8:42 am
by Eddie Willcox

Hi,

I have read the tutorial on building a clickable list with html5 localstorage, but this is not exactly what I'm looking. I am extremely new to this and I need a lot of help.

Basically what I have done so far is to create a page with collapsible sets. Under each collapsible header I have lists with static values (I might to change this). What I want is to be able to click/tap on the list and this must then navigate to another page and only show me the data that is associated with the parent page list header. The data has 2 columns it must select from to show the data on the item_info page. The columns are called segment_1 and segment_3.

For instance, on the parent page (the one with the collapsible sets and lists) I will have a a collapsible block with heading CD and below that a list with heading Alternative. When I click/tap, it must navigate to the item info page, but only show me data that is relevant to CDAlternative. Thus it must select from the data only those items with segment_1 values "CD" and segment_3 values "AL" and then display the information I want it to display.


Retrieve data using clickable list

Posted: Wed Dec 11, 2013 9:09 am
by Kateryna Grynko

Dear Eddie,

On item click, you can save its text or anything else, adding an appropriate handler for Click event on Events panel.


Retrieve data using clickable list

Posted: Wed Dec 11, 2013 9:24 am
by Eddie Willcox

Hi Katya,

Ok, that sounds easy enough, but when I have set the text property to what I want it to be, how do I then use this property to load the info on the next page?


Retrieve data using clickable list

Posted: Wed Dec 11, 2013 9:30 am
by Kateryna Grynko

Eddie,

I recommend you this pretty simple tutorial that shows how to work with localStorage: http://docs.appery.io/tutorials/build...


Retrieve data using clickable list

Posted: Wed Dec 11, 2013 9:33 am
by Eddie Willcox

Thanks Katya. I will go through it. If I have more queries I will let you know.


Retrieve data using clickable list

Posted: Thu Dec 19, 2013 10:05 am
by Eddie Willcox

Hi,

I tried replicating the tutorial in my scenario, but when loading the next page, it times out and does not display anything.


Retrieve data using clickable list

Posted: Thu Dec 19, 2013 10:25 am
by Maryna Brodina

Hello! Please check are there any errors in console?


Retrieve data using clickable list

Posted: Thu Dec 19, 2013 11:04 am
by Eddie Willcox

There are no errors, but I do see a warning: event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

it's not timing out at the moment, but it's not displaying what I expect it to display


Retrieve data using clickable list

Posted: Thu Dec 19, 2013 12:18 pm
by Maryna Brodina

Could describe in more details what have you done? Screenshots would help.


Retrieve data using clickable list

Posted: Thu Dec 19, 2013 1:10 pm
by Eddie Willcox

Here is what i have done:

  1. Created a page with collapsible sets
  2. Added lists under the sets
  3. Created tap events on the list items to set local storage variable segment_1 to CD (will have to do this on all the list items setting segment_1 to whatever it must be), set another local storage variable segment_3 to whatever segment_3 must be to show the correct data and then navigate to a page Image
  4. On the second page, i have 2 hidden labels (segment_1, segment_3). On page load, i set the labels property to read from their respective local storage variables then invoke my listing service to list the items: Image
  5. the data listing service request tab: Image
  6. the response: Image