DanR
Posts: 0
Joined: Wed Sep 10, 2014 10:59 pm

Master Detail Using POST

Is it possible to use the output of REST POST (i.e. distinct values) in master detail page scenario?

Because the master detail page requires an ID to pass along to the next page and POST only provides one field from the DB (i.e. no ID field in the output) is it type of setup possible?

If this is not possible any thoughts on setting up an app that does the following?

Master Category Sub category

Category and Sub Category are from the same collection is why I need to do run a POST query to get the sub category list.

Thanks

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Master Detail Using POST

Hi DanR,

Please provide us screen shot with your current implementation and DB collection.

Currently your problem is not clear.

Regards.

DanR
Posts: 0
Joined: Wed Sep 10, 2014 10:59 pm

Master Detail Using POST

Hi Yurii

I have the POST response below

Image

Going to the list below

Image

I am using this as a detail page where I want to know which category the user chooses that when I get to next page I can filter based on their choice.

I am trying to do this without using a hidden label because I need to define the variable within the query and this can't be don't with a regular hidden label method.

I am wondering if this strategy is possible because POST service only provides 1 list of items and will not provide a corresponding ID that seems to be needed when using a master detail page setup.

Are you able to advise whether this is possible? At the moment this is not working for me.

Thanks for the help

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Master Detail Using POST

Hi DanR,

It's looks ok, and should be able to implement, but it's still not clear about your full implementation.

So it should be faster if you will give us your app public link and will provide us steps to reproduce this problem.

We will take a look.

Regards.

DanR
Posts: 0
Joined: Wed Sep 10, 2014 10:59 pm

Master Detail Using POST

Hi Yurii

Please find public link here:

http://appery.io/app14/mobile-frame?s...

The reason I ask about this is that at it's root the POST function only seems to return one value, so there is no ID to determine which value the user chose which can they be passed onto filter the next page.

Thanks for your help

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Master Detail Using POST

Hi DanR,

Please provide us with steps to reproduce your problem.

Regards.

DanR
Posts: 0
Joined: Wed Sep 10, 2014 10:59 pm

Master Detail Using POST

Hi Yurii

The app has the following structure

StoresCategoriesMenu items

Create Master detail page from store list below

Image

Based on the users choice we then determine what are the potential categories based on the store in the menu collection. to do this we use POST as there are many potential menu items with the same category.

The menu collection is below

Image

The user then chooses the category so then when we get to the menu page we've filtered on Store and category to end up at the final collapsible list.

because I'm querying based on two values I need to use master detail without a hidden label.

The issue is that POST only returns on piece of data and I need it to return an ID of category so that I can then filter again when we get to the menu page.#

Thanks for the help

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Master Detail Using POST

Hi DanR,

As i can see you using "distinct" service to populate categories list.

And thus you can not get categoryId to store it when user click on category item.

That's not good way to implement. You should have category "id" when service populates a list and populate with this "id" some hidden label. Then you can get this label value and store to some LSV when user clicks on category item.

After on menu page you can get "categoryId" LSV and "storeId" lsv and make following where clause:

pre

//Get current store id.
var storeId = localStorage.getItem("storeId");

//Get current category id.
var categoryId = localStorage.getItem("categorydId");

var whereObject = {"$and": [ {"IDX_store": storeId}, {"IDX_categ": categoryId } ] };

return JSON.stringify(whereObject);

/pre

Regards.

Return to “Issues”