Studystylerz
Posts: 0
Joined: Thu Feb 13, 2014 3:38 pm

dynamic list only retrieves value for 1st id...

Hello I followed the process to create a dynamic list. I understand how to create the two pages and they appear to be working. The first list is a list of incident ids, the second list should show details [values] for a few variables in the collection.

Problem
The second list only shows the values for the first id that I click. When I click the second or the third id, I always get values from the first id. It's either a bug or I've got a config off somewhere. Can you help?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

dynamic list only retrieves value for 1st id...

Hi,

Do you have a list mapping like this? http://docs.appery.io/tutorials/build...

Studystylerz
Posts: 0
Joined: Thu Feb 13, 2014 3:38 pm

dynamic list only retrieves value for 1st id...

I thought the second page should be a 'read' service, not a 'list' service. The first page 'list' service works perfectly. Should I change the service on page 2 to list?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

dynamic list only retrieves value for 1st id...

How do you save a value of the clicked element? Do you use 'set localStorage variable'?

It's better to add this code on list item click:prelocalStorage.setItem("variableName", $(this).text());/pre

Studystylerz
Posts: 0
Joined: Thu Feb 13, 2014 3:38 pm

dynamic list only retrieves value for 1st id...

Hello, I've fixed this problem but I noticed that list one is not being generated unique to user id. In other words, for every user, all records in collection are being displayed. I need only that user's records to be displayed.

On list 1's 'Request' page, I've mapped 'session token' to local storage variable 'session token'. I thought that would work. Please help!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

dynamic list only retrieves value for 1st id...

Hello, we need more time to figure this out, will update asap.

Studystylerz
Posts: 0
Joined: Thu Feb 13, 2014 3:38 pm

dynamic list only retrieves value for 1st id...

I added _id to request on list service. Then I mapped _id to new local storage variable. I also unchecked 'header' from 'request' list. Still not working.

Studystylerz
Posts: 0
Joined: Thu Feb 13, 2014 3:38 pm

dynamic list only retrieves value for 1st id...

I continue to research. The 'create' service [which updates the collection] has acl added. Using list service, I'm now mapping only session token to session token, then the request variables that i need. Please help!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

dynamic list only retrieves value for 1st id...

You suppose to have two pages:

List page (with list items).
ListItem page (where your item have to be displayed in details mode).

First Page:

  1. Drag and drop list element on the page.

    Add to list item "label_itemName" for display name of the element, and second "label_itemId" is just to save id for this one.

  2. Add Datasase service for yor collection and select there "list" and "read" methods. Add service on page. Map the answer name to "label_itemName" and id to "label_itemId"

    3.On Click event setLocalVariable "selectedItemId" and Target Component - "label_itemId

  3. On Click event Navigate to page "details".

    Second page:

  4. Create datasorce "getItem" for "read" service.

  5. Open mapping for this datasource and use "selectedItemId" localVariable for fill request field objectid.

  6. Open response tab in "getItem" datasorce and map your view to server response.

Return to “Issues”