maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create a mapping as attached via javascript?

Can you tell us what exactly you are trying to do? What functionality to add?

Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to create a mapping as attached via javascript?

I do have a json file with different categories like Automotive, Hotels and others.
On one screen all those categories are already listed. Depending what one is choosing from this list, I want to display the result (all hotels or all car garages...) in a new screen. How can I change the content from the new screen from hotels to garages? I thought I can store the choice from the first screen in a variable and pass it over to the new screen to bind the result to the list.

Saw an example in the docs which was working with rest requests, but I do have only the response from the rest service.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create a mapping as attached via javascript?

So, the entire response (all categories) you get in the initial request?

Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to create a mapping as attached via javascript?

Yes, here you can see the different categories.
Each category deos have the same attributes. Image

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create a mapping as attached via javascript?

You could save the entire JSON response in local storage and then pick the category that you need on the next page.

Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to create a mapping as attached via javascript?

please, can you specify 'picking the category'. Do I have to use some jacascript for that?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create a mapping as attached via javascript?

Here is a simpler way to do this.

You can define a separate service for each category. Service input would be the same for all. Service output would be different. For example, if you need to display the Virtual Tour category, the service response would be this:

code
Geocockpit
__Virtual Tour
/code

(the __ is added for formatting)

For a service that shows the Popular Sites category, the response would be:

code
Geocockpit
__Virtual Sites
/code

and so on. As the service output doesn't have any other categories, those will be basically "dropped".

Every page would hold one category and use one service.

Bernie
Posts: 0
Joined: Fri Jul 27, 2012 2:06 pm

How to create a mapping as attached via javascript?

HI Max,
unfortunately it's not working that way. Will read the categories by jquery from the JSON file and put the results manually into the list.

Thanks for your help.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create a mapping as attached via javascript?

You would still read the entire response each time but on the response side, you will only return the required category.

Return to “Issues”