Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi Developers,
I have a parent mashup which has a collection widget. On collection widget, I have a textfield widget.
Requirement is to refresh another service on parent mashup whenever a user enters value in the textfield widget. This service is used as input to second collection widget on same parent and we need to refresh values on second collection widget.
Issue is that use of global parameter or session parameters are not allowed in our organisation.
Kindly suggest some expression or way to achieve this.
Thanks in Advance.
Hi @VK_10159720 ,
I did a workaround for the same kind of scenario in my project. It may helps you.
Step 1: Create a Expression with Randon Number Generation in Collection's Child Mashup it should execute on TextBox Values Changed Event and Pass the expression output to 1 Number basetype Mashup Parameter (MP_RandonNumber)
Step 2: In Collection Widget eidt & update the MashupGlobalPropertyBinding property with created child mashup parameter name which carrying the randon number from child mashup & its basetype.
Step 3: Create a auto evaluvate Expression in Parent Mashup to print the data of randon number from collection (ex : Output = MP_RandonNumber).
Step 4: Based on the Expression Changed event you can execute the service from Parent Mashup.
I have attached the demo entities FYR - Import Datashape, Thing & Mashups. Kindly let me know if any queries. Also commuity please let me know if any easy way there to achieve it.
Note: This will works based all cells textbox values changed.
Thanks & Regards,
Arun C
Without using session parameters, I imagine that's going to be a bit tricky. I did some testing on a ThingWorx 9.0 expression and it does appear that you have access to the local storage api:
localStorage.setItem("testing","123");
However, you wouldn't get any ThingWorx event from that and I'm not sure your organization would allow that either. The server side option would have to include Things or Data Tables that store that value and perhaps update some property on a session or user-specific thing. Then you can use the web-socket feature of getProperties to immediately know when that property has been updated... but that's a lot of complexity in my opinion
- Nick
Similar to nmilleson's reply;
Either move that textbox out of the collection or when you enter a value, have that call a service which updates a things property. On the parent mashup, use getProperties to actively monitor/push that value change to the execution of the second service.
@VK_10159720 can you check Rocko's response ? if the solution is good for you, please mark it as "accepted solution". Thanks.