Catalyst Creations
Posts: 0
Joined: Sat Dec 28, 2013 1:34 am

Master detail page.. not using hidden label id??

Hey Guys,

I'm trying to create a master detail page for a company list. I'm using my database collection to populate the list with the hidden label as the id. when i go to the next page it will only populate it with the first entry in the database but not the company that I clicked on in the list.. seems not to be using the id to show the appropriate company.. please tell me what am I missing?

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

Master detail page.. not using hidden label id??

Hi,

Please tell in details what you have tried (steps to reproduce, mapping screenshots, so on)
Did you check this tutorial http://docs.appery.io/documentation/b...?

Catalyst Creations
Posts: 0
Joined: Sat Dec 28, 2013 1:34 am

Master detail page.. not using hidden label id??

Hey,

I created a DB that stores company name, contact and details.

I created a user login and signup which works fine. On home page after login there is a button that goes to another page where user enters in company details then clicks save which in turn goes back to home page and saves data in DB. Also on the homepage is a list that is populated by the DB list service when page loads. I followed the tuts for the master detail page using the hidden value way. Using the database list service I mapped the following : Image

Image

I also made the list item set local storage variable on click and also navigate to company details page on click.

On the company details page i setup a grid with labels inside for each colounm of the companie collection... Mapping as follows:
Image

Image

also invoked the service when page loads. Now if i go back to home page list is populated with the users company entries, Pondalowie and a couple more. When I click on any of them they dont display the company i clicked just the first entry in the database collection..... Not sure why it wont register the id. I check console and the value is being passed to local storage... it just not using it on the company details page... PLease help?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Master detail page.. not using hidden label id??

Hi,

On second screenshot in service response you mapped '_createAt' to the 'Id' text property -- this supposed to be so?

Catalyst Creations
Posts: 0
Joined: Sat Dec 28, 2013 1:34 am

Master detail page.. not using hidden label id??

Hi,

I needed a unique id that was a string in order for local storage to read properly.. and thought the _createAt would be unique to each db entry.. and is a string.. i tried it with the database collection entry id as well.. but the local storage wouldn't take it... is there another way?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Master detail page.. not using hidden label id??

I suggest you to check the part of the tutorial that Alena advised you above -- there are pretty well described several approaches how to do that with storing 'id'.

Catalyst Creations
Posts: 0
Joined: Sat Dec 28, 2013 1:34 am

Master detail page.. not using hidden label id??

Ive followed it three times, both ways. My problem is that it wont picj the id for the details page????

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Master detail page.. not using hidden label id??

Hi --

The solution from Igor helped you?
I repeat it here in case it will be helpful for someone on the forum:

  1. Create Query service http://docs.appery.io/tutorials/build...
  2. Add query service in "Company1Detail" page.
  3. Map "NewId" localStorage variable to where clause.
  4. On request tab Add JS code to where clause field
    prereturn '{"_id":"'+value+'"}';/pre
  5. On response tab. Map service response fields to page components.
  6. Add service invoke on "Company1Detail" page.
Catalyst Creations
Posts: 0
Joined: Sat Dec 28, 2013 1:34 am

Master detail page.. not using hidden label id??

Hi Illya,

Yeah the solution worked but it will only work if you invoke the service on page show not load... load seems to keep an instance of the first button choice regardless of how many times you go backwards.. until you logout.. which is why I thought the page show would work as it refreshes on every navigate...

Thank you very much guys.. you where awesome... Appreciate it very much...

Callum.

Return to “Issues”