Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
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
Solved! Go to Solution.
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
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.
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.
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.
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
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
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