cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to programatically navigate to a mashup while using collection widget

bootstrap
12-Amethyst

How to programatically navigate to a mashup while using collection widget

I have a main mashup with contained mashup with footer showing bunch of icons representing mashups (using collection widget). Based on the icon selection on this menu I can navigate to different mashups in that contained mashup area.

 

One of the mashup shown in contained mashup area has a Navigation button. I am looking to navigate the user to a different mashup instead of showing a pop or modal popup. Though when using the replace window option, the new mashup completely replaces the current view, including the footer and thus loosing the foot completely.

 

Is there an efficient way to replace the mashup only in that contained mashup area instead of navigating completely away from the current mashup.

 

Thanks.

ACCEPTED SOLUTION

Accepted Solutions

Final update :

 

I did it bit differently (since the menu in my main mashup is driven by collection widget), may be of help to someone else trying. I think @BennyB your option was good as well

 

1. Created a session parameter to hold mashup name

2. In helper thing I created 3 services

a. Setting session param

b. Getting session param and driving the collection widget (as this is what drives the footer icons)

c. Resetting the session param after 1st load

3. On button click e.g. Mashup B, i called navigation via navigation button which also sets the session param to hold the mashup name and then navigate to main mashup

4. On main mashup load after the getMenuItems service finish invoking I invoke the service setting the mashupname in contained mashup

5. I call the service to clear the session variable which held the mashup name.

View solution in original post

5 REPLIES 5
posipova
20-Turquoise
(To:bootstrap)

Have you considered using a Master mashup? that way you will have a permanently attached "header" with all the required content.

bootstrap
12-Amethyst
(To:posipova)

Thanks for reverting.

 

I am not sure how will that help, I did shortly consider but didn't go forward due to following reasons

 

1. Not all contained mashups need header at all time, i understand hiding it might be an option but then if it's there it will take bandwidth while loading anyhow (or am I wrong to have that thought process?)

2. Only few of these contained mashups have buttons, so a header is not always needed, plus it will eat up scarce resource i.e. the on screen space which is between 9-12 inches

3. I want to keep these mashups as light as possible, meaning fewer contents to load the better because these mashups will be loaded on a tablet in the field where connectivity will vary a lot.

 

I was hoping that I could somehow navigate, via service, the collection widget to simply replace the contained mashup instead of forcing users to manually click through the icons which completely breaks the user experience. 

If a Master is no option you may want to use a dedicated Thing to support your Mashup. I built a small example, see attachment. I think it does not need much description but I do my best:

  • MainMashup has the requested Footer and ContainedMashup widget
  • ContainedMashup1 and 2 have Buttons to Navigate to the other Mashup
  • The Thing YourMashupHelper keeps track of the last requested Mashup. The ContainerMashup widget is bound to its property MashupName.
  • The point is all buttons do not actually Navigate but call the function SetMashupName to only set the property of YourMashupHelper.
  • Important: In Main Mashup the GetProperties Service needs the "Automatically update when able" flag set to true, this will trigger an update when a ContainedMashup sets MashupName.
bootstrap
12-Amethyst
(To:BennyB)

thanks @BennyB  I was thinking something on similar lines but couldn't fully formulate it yet. 

 

So thanks for sharing this, I am gonna find time to test this out and will get back.

 

Much appreciated!

Final update :

 

I did it bit differently (since the menu in my main mashup is driven by collection widget), may be of help to someone else trying. I think @BennyB your option was good as well

 

1. Created a session parameter to hold mashup name

2. In helper thing I created 3 services

a. Setting session param

b. Getting session param and driving the collection widget (as this is what drives the footer icons)

c. Resetting the session param after 1st load

3. On button click e.g. Mashup B, i called navigation via navigation button which also sets the session param to hold the mashup name and then navigate to main mashup

4. On main mashup load after the getMenuItems service finish invoking I invoke the service setting the mashupname in contained mashup

5. I call the service to clear the session variable which held the mashup name.

Announcements


Top Tags