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

Modal popup return value

SOLVED
Level 8

Modal popup return value

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Modal popup return value

You can check out https://community.ptc.com/t5/IoT-Tech-Tips/Forced-Root-Cause-Monitoring-via-Mashups-and-Modal-Popups...

 

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

Re: Modal popup return value

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.

Re: Modal popup return value

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.

Re: Modal popup return value

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. 

Re: Modal popup return value

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

 

 

Re: Modal popup return value

You can check out https://community.ptc.com/t5/IoT-Tech-Tips/Forced-Root-Cause-Monitoring-via-Mashups-and-Modal-Popups...

 

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

Re: Modal popup return value

@khayes1

 

Hope you are doing good. Could you please confirm if the issue has been resolved.

 

If yes, please mark the answer as accept as solution for the future reference. Thank you in advance.

Regards-Mohit Goel