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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Return a value from a popup

wposner
1-Newbie

Return a value from a popup

Hi Everyone...

I'm looking to create a "search" mashup to be used as a popup--basically a textinput widget to enter the search string, and a grid to display the search results.  When the popup closes, I need to get the selected row from the grid and push it to a textinput widget on the calling mashup.  I know I can use a session variable to store the selected item from the search results and then use a service read the session variable and set the text input field on the parent form, but I'm wondering if there's any other way to accomplish this without using a session variable.

Thanks!

Wayne

3 REPLIES 3
Aanjan
9-Granite
(To:wposner)

Wayne, if this search option is going to be present in the Master Mashup, you could possibly look into using Mashup Parameters too. Maybe create a parameter of type Infotable with a set DataShape and bind your selected rows to that.

wposner
1-Newbie
(To:Aanjan)

I'm not sure I'm understanding what's you're suggesting.  Even with a mashup parameter on the pop-up mashing containing the selected data, how would I pass that information to the correct text field on the calling mashup when the pop-up mashup closes?

Aanjan
9-Granite
(To:wposner)

As a quick test, here is what I did - I created a 'Search' Mashup with a textbox and grid. I created a custom ThingTemplate called 'BaseTemplate' based on GenericThing, added a property called 'TestName' and created two Things based on this Template. I added two different values for 'TestName' on both Things. Now, on my Search Mashup, at the 'Add entity' section, I checked Dynamic and added my BaseTemplate's GetPropertyValues service. I bound my texbox to 'EntityName' and bound 'All Data' to the grid. I then created a Mashup Parameter called 'GridValue' and bound 'TestName' from 'Selected Row(s)' to that. I also bound the 'Changed' event of the textbox onto 'GetPropertyValues'.

I then created a Master Mashup, added a textbox to the header section and added a Navigation widget and chose my 'Search' Mashup. Once I did that, my Mashup Parameter was visible at the drop down menu of the Navigation widget. I bound this parameter onto the textbox in the Master Mashup just to check if the value carriers over.

Now, when I view my Master Mashup and click on my Navigation widget, I get a pop up with a textbox and a grid. Once I type in my ThingName (Thing1 in this case), the grid gets populated with its properties. If I select a row, I see that the textbox in my Master changes according to the row I chose.

I hope this isn't too confusing

Top Tags