I Have added scope=’S’, now it is not throwing any error but not updating table data.
let me explain what exactly I am doing-
1- I have a view with table component which displays the status, I want to refresh this table when status is updating from other views or tags.
2- instaed of using polling rate I am using the message handler.
3- table view is created in parent project and has message handler on it to refresh the bininding.
4- this table view is inherited in child, so in child I have gateway event tag change script, which is calling script library function which is updating the status.
wherever in script libary status is updating there I am calling message handler like below
In the child project, the RefreshList message handler needs to be a Session Message Handler, that will rebroad cast the message any view or components message handlers in the project.
Essentially, you need an additional message handler that listens for the message sent from the tag change event, and then rebroadcasts it using system.perspective.sendMessage() to the RefreshList message handler. Just as @ryan.white said above.
@lrose, you need to add scope='session' to the function call, otherwise it will not work. The value defaults to page, which requires a pageId, which won't be available in the message handler.
The project library should reference the Session Message Handler.
In the future, you can add additional messages to be 'refreshed' to just be called from the message handler, and if you get really fancy you can send the message handler name in the payload to the Session message handler, so that you can dynamically broadcast to any message handler in the session.
Are you testing on an actual session or just designer? Designer will not listen to messages sent via system.util.sendMessage
Messages cannot be received within a Designer. However, messages can be sent within the Designer in a script (assuming that read/write comm is enabled).
Also make sure you have saved the project after all these changes.
Might be a wording thing with the manual, but the payload argument is not listed as optional on system.perspective.sendMessage. Try changing your call in the Perspective session message handler to include an empty dict for the payload.