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 the Community Ranking System, a fun gamification element of the PTC Community. X

Session parameters "changed" event not firing

fblondy
7-Bedrock

Session parameters "changed" event not firing

Hi there

I have a very simple mashup with a contained mashup.

In the contain mashup, there's a button that call a service that change a session parameters and I'd like to do something in the parent mashup when this happens.

But it does not work, the session value is not updated in the parent mashup (nor in the child mashup for that matters) and the event is not fired.

Our real use case is as follows:

- a main mashup with a repeater

- a small mashup passed to the repeater to display our Things or an add button to create new things

we'd like to refresh the main mashup when a new thing is created but can't find any solution to do so (and the session parameters option seemed the most logical)

8 REPLIES 8
qn
12-Amethyst
12-Amethyst
(To:fblondy)

Hi,

if the session parameter is not updated in the contained mashup with the button, there's maybe a problem with the button or the service called by the button.

fblondy
7-Bedrock
(To:qn)

I don't even care about the value but the event is not fired.

The button and service works fine, I even return the new session value and display it in the contained mashup, and it does change each time I click the button but still, the event does not fire and the value fetched directly from the session variable does not change (I bound it to a value display widget)

And before someone thinks it's my code and ask for it, here it is :

var params = {

    name: "refresh" /* STRING */,

    value: 1-Resources["CurrentSessionInfo"].GetGlobalSessionValues().refresh /* NUMBER */

};

Resources["CurrentSessionInfo"].SetGlobalSessionNumberValue(params);

var result = Resources["CurrentSessionInfo"].GetGlobalSessionValues().refresh;

qn
12-Amethyst
12-Amethyst
(To:fblondy)

Ok I understand that the session parameter in the sub mashup is updated but not the one in the main mashup. Did you verify the binding of the session parameter of the main mashup ?

fblondy
7-Bedrock
(To:qn)

no, the value fetched directly from the session parameter (binded from the session tab to a value display widget) is not updated, not in the sub nor in the main mashup. The one getting updated is the one I fetched from the service result. Every binding is good as I get the value when the mashups are loaded, but they're not getting updated, and more importantly, the event 'changed' is not fired, when the service is called and effectively change the value

The Data Changed event in Composer  is completely client-side. It does not recognize changes to the session data which occurs at the server. This means you will not get an event in the mashup if you make a SetGlobalSession* service call at the server. Instead, you need to bind the result of a service executed in the mashup to one of the session properties. Then you will actually have the event fire in the mashup.

Hi, I tried to use this feature to update my "parent mashup", unfortunately the event "dirtyFlagChanged" is somtimes not fired.

I havn't anything into console or monitoring tools.

2/3 the event is fired, otherwise not.

I work on Thingworx 7.1.4.

Have you any idea about this?

Try using the mashup trace when you're running "View Mashup" and look at the calls being made in the trace. Do you have an export file I could look at / try here?

Hi, I traced the mashup but the event wasn't fired.

I tried to change the Data Change Type of my property to "ALWAYS" without improvement.

I finally fixed my issue by changing the property type to a datetime, and my service returns the current time. With that workaround the event is fired correctly.

Regards

Announcements


Top Tags