Bert Vandenbogaerde
Posts: 0
Joined: Thu Dec 19, 2013 11:10 am

Clickable list

Hello,

I am totally new to this.

the project link:
http://appery.io/app/mobile-frame?src...

Tab: Menu

I try to create a clickable list.
The list items are populated from the appery DB.
I follow this tutorial:
http://docs.appery.io/documentation/b...

I get it to work untill the "local storage variable".

But i get lost with these steps:

  • Now that the value is stored in local storage, you can use it on the next page or any other page in the app.

  • Because the local storage variable was created via an action, you don’t need to create it by hand for mapping. Mapping the id for service invocation:

  • When you navigate to the next page, you can invoke the service on page show event.

    do i have to create a new collection with the detail information?
    How do i link the specific list id to the specific details for that list id.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Clickable list

Hello!
[quote:]do i have to create a new collection with the detail information[/quote] it's up to you, you can add new field in existing collection or create a new one
[quote:]How do i link the specific list id to the specific details for that list id[/quote]you can use Pointer field type http://docs.appery.io/documentation/b... (see Data Types section). You can use where clause in the request http://docs.appery.io/documentation/b... (Query Constraints)

Bert Vandenbogaerde
Posts: 0
Joined: Thu Dec 19, 2013 11:10 am

Clickable list

I am trying to understand but it does not work for me.

This is my DB structure on appery:

_id section (string) detail (string) acl _createdAt _updatedAt

the values in "section" are populated in the list (on the "menu" page). That works fine.
Now i want that when i click on a list item, it goes to a page called "detail" and opens the "detail" value corresponding to the list item i clicked.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Clickable list

Do you have this information with detail? Looks like there is no info in this collection? Do you have any other collection? You can add column for detail in existing collection.

Bert Vandenbogaerde
Posts: 0
Joined: Thu Dec 19, 2013 11:10 am

Clickable list

Image

All the info is in the DB collection.

I would like the values in the detail column to display on my detail page when i click a list item (section column).

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Clickable list

On detail page you have to add object id in url (here is more information http://docs.appery.io/documentation/b... - Retrieve a specific object). So

  • service URL should be pre{database_url}/collections/MenuSection/{obj_id}/pre- in request parameters add obj_id
  • do mapping from localStorage variable where you store object _id to obj_id.
Bert Vandenbogaerde
Posts: 0
Joined: Thu Dec 19, 2013 11:10 am

Clickable list

I am getting close.

Now i linked the obj_id to the URL:

Image Image Image Image

as you can see, i get undefined message...

I think i get close :)

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

Clickable list

Hi Bert,

1) How do you save a value in 'itemId' variable?
2) You should also send Session token as a Request parameter: http://docs.appery.io/documentation/b...

Bert Vandenbogaerde
Posts: 0
Joined: Thu Dec 19, 2013 11:10 am

Clickable list

1)
Through local storage variable, the action takes place when a list item is clicked

2)
X-Appery-Session-Token is visible on the request tab.
With what value does it have to be connected?
Does it have to be connected on my main page mapping or on the detail page mapping?

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

Clickable list

Bert,

1) Please make sure the variable is set correctly.
2) On page 'detail' (your screenshot of mapping without session token) please check if there are any errors in console again (F12).

Return to “Issues”