Perspective view taking too long to load

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.

  1. wherever in script libary status is updating there I am calling message handler like below

    image

Below is inherited view with message handler

am I missing any step here?

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.

how to do it, can please tell me, I am not sure on session message handler.

@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.

1 Like

Do we need to call the session message handler in project library?

As I created session handler with name ‘updatelistschedule’ and table component message handler is ‘RefreshList‘.

which one will be in the project scrip libarary?

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.

got it, let me try this.

No, still not updating….

below is script library call,

image

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.

I am testing in client, yes project is already saved.

let me try by closing and relaunching the client.

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.

Is there an error in your gateway log?

No, still not updating. No error in gateway log.

What I am doing is -

in one browser tab table view is open and in other tab different view is open which is calling gateway tag change script >> script library script.

and checking when status is updating from 2nd tab, it will immediately reflect on table view with message handler.

okay, will try with empty dict

No luck.

Any other thing to try ?

Call support and have them look over your sholder.

Report back with what you find.

okay.

Anyways, Thanks all for your quick response!!

empty dict got missed at one place, now it is working ..

Appreciated!!!