Skip to main content
1-Visitor
November 10, 2018
Solved

Modal popup return value

  • November 10, 2018
  • 6 replies
  • 3186 views

Hi,

I'm looking to return a button id from a modal popup to the caller mashup. Effectively I'm trying to create my own confirmation (Yes/No) type dialog and want to pass back to the calling mashup which button was pressed.

 

On the face of it you would think that it is something that should be pretty simple, but struggling to think of a way whereby I can pass the button ContexId from 2 buttons to a single return value. I realise I could do it with a global session variable but it feels like there should be a more elegant/contained way to do this.

 

Thanks,

K

 

Best answer by mneumann

You can check out https://community.ptc.com/t5/IoT-Tech-Tips/Forced-Root-Cause-Monitoring-via-Mashups-and-Modal-Popups/td-p/581047/jump-to/first-unread-message

 

It's a collection of posts that create a use case step by step.

It also includes on how to create the radio button options and then assign the value to the Mashup Parameter, which will then be read on the Mashup that initiated the modal popup.

 

It's a bit long to read though 😉

 

 

Cheers,
Michael

6 replies

5-Regular Member
November 12, 2018

If you want 2 buttons instead of a Radio Button, you can use this 2 buttons to trigger 2 services. Each service define the property to be True or False. That could work.

khayes11-VisitorAuthor
1-Visitor
November 14, 2018

Hi,

thanks for the reply. I did originally try this approach, but couldn't figure out a way to bind the result from 2 different services to a single mashup parameter. 

16-Pearl
November 12, 2018

You can create a Mashup Parameter for the popup-Mashup

Assign the value (true / false) to the Parameter.

After closing the popup you can access it via the Navigation Widget's properties.

 

I'm currently working on quite a long post that includes this behavior - check the IoT Tech Tips 😉 I'll probably be able to post everything until the end of the week.

khayes11-VisitorAuthor
1-Visitor
November 14, 2018

Hi thanks for the reply. 

The bit I can't figure out how to do is how to assign the true/false value to the mashup parameter depending on which button has been pressed.

 

In the end I went with 2 services. Each one sets a global session variable to either true or false. I then check that session variable after the popup is closed. It works fine, but I was hoping to encapsulate the problem inside the popup without having to resort to global variables.

K

 

 

mneumann16-PearlAnswer
16-Pearl
November 14, 2018

You can check out https://community.ptc.com/t5/IoT-Tech-Tips/Forced-Root-Cause-Monitoring-via-Mashups-and-Modal-Popups/td-p/581047/jump-to/first-unread-message

 

It's a collection of posts that create a use case step by step.

It also includes on how to create the radio button options and then assign the value to the Mashup Parameter, which will then be read on the Mashup that initiated the modal popup.

 

It's a bit long to read though 😉

 

 

Cheers,
Michael