8 Replies Latest reply on Sep 16, 2016 3:03 AM by rpallares RSS
    francky Explorer

    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)

      • Re: Session parameters "changed" event not firing
        qn Communicator

        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.

          • Re: Session parameters "changed" event not firing
            francky Explorer

            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;

              • Re: Session parameters "changed" event not firing
                qn Communicator

                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 ?

                  • Re: Session parameters "changed" event not firing
                    francky Explorer

                    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

              • Re: Session parameters "changed" event not firing
                brucehul Apprentice

                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.