we have multiframed page, where one frame depends on state of another. More detailed - frame #1 knows when frame #2 should be shown. The usual way of visibility state changing doesn’t work - frame#2.setIsVisible(true); The only way we’ve found is to change in frame #2 state of some local variable and using a timer to check this state time to time and only then call this.setIsVisible(true);
Could you please advice us a better way?
actually we’ve received yesterday a solution purposal which works (see below), but nevertheless our original way was the following:
we’ve used a polling based on timer in order to check whether an internal variable which is accessed by another frame was changed. If it was indeed then the visibility prooperty was changed accordingly in onTimer() method.
This was quite stupid of course, but it worked.
New solution is much better. We’re simply using the refreshTarget(“NAME_OF_FRAME_2”); method instead of timer usage.
Thus the task is closed.
Thank you,
Regards,
Roman
—8<-------------------------
Support Request #649441…
If the multi frame page is built with Application Designer there are two ways to “influence” the frame #2 (within frame #1 processing). Either use API…
refreshTarget(“NAME_OF_FRAME_2”);
…or…
sizeTarget(“0”, “NAME_OF_FRAME_2”);
The first point forces a refresh of frame #2 (without the need for a timer).
With second alternative the width of frame #2 is set to 0 (ie frame #2 is not visible anymore).
Precondition for both alternatives is that the multi frame page is built with App Designer. This is done using a MFPAGE tag when creating a new layout (new layout dialog provides for a MULTIFRAME template. Use this template).
Within the MFPAGE each frame is represented by a CISFRAME. At the CISFRAME tag specify the URL (use attribute CISURL) and specify TARGET (this is actually the name you can use later on in API refreshTarget or sizeTarget).
In addition API openCISPageInTarget may be of interest.
But there is another question - is it possible similary to refresh page from outside of frame?
More detailed. We have a static class instance which makes polling of statistics data. When some changes occure this instance calls a method of our adapter class (registred via interface). I’m trying to call refreshTarget(“NAME_OF_FRAME_2”); inside of this method, but no refresh happens. Why? And how to avoid this?
is it possible similary to refresh page from outside of frame?
A refresh of client side can be triggered from a HTTP request processing only. Ie precondition of client side refresh is server flush triggered by user interaction (or by a timer). It is not possible for a server side “daemon” to reach UI/browser without any HTTP communication.
HTTP behaves like the Hollywoods principle: do not call us - we will call you (ie the client is the one to call).