justinmind-logo
 
Upvote 1

Using a master multiple times in a single page and using a screen element to set the data

Answered Withers Davis 8 years ago

I have a screen that will repeats the same data structure (from one data master) in multiple sections, but with different data. I would like to use a master for the display of the data (to make it easily updatable) but would like for the various instances of the master to display different data.


So for example - lets say I have a data master call 'cars'. One field is 'brand' and we'd have Ford, Toyota, and BMW. There would be many cars for each brand.


I'd like to have my screen structured as follows:


Brand: Ford


{data list of cars that have brand = Ford}


Brand: Toyota


{data list of cars that have brand = Toyota}


In this example I would like to use a master for the data lists. I then would think I'd need to use the brand label as the filter criteria. However, I can't figure out how to do this. Is this possible?


Thanks!

Replies (5)
photo
1

Hi there,


We actually have a tutorial that describes just this! Check it out here: http://www.justinmind.com/support/fil...


Best,


Danielle

photo
1

I'm not sure that answers the question. I'm looking to use a master (i.e. a template) that contains a data list. I want to use that master multiple times on the same page but have each instance use a parameter to filter the data master differently.


The words master and data master are a bit confusing. My specific issue/question is related to masters, not data masters.

photo
1

Hi.


unfortunately it's not possible to create events in masters as they cannot differenciate the master instance location. As a workaround you could work directly into the screen without using masters. Sorry for any inconvenience.


Best,


Sonia Durán

photo
1

OK so I was actually able to create a workaround. It is a bit of a hack but it works. Figure I'l post it here so that other people could do the same.


In order to distinguish between masters I created a variable called master_id. I then created a on page load event in the master that increments the value of the master_id variable by one. In the page that contains the masters I have an on page load event that resets the master_id variable to zero.


In my instance I have the same master repeated 4 times on the screen. As the masters load the variable updates the value so the values end up being 1, 2, 3, and 4. I then use a while statement in the master page load to modify the displayed data.

photo
1

Thanks for sharing !


Best,


Sonia

Leave a Comment
 
Attach a file