Screen Events and Browser Checking

Hi,

I got a JS that detects the browser and redirect it to a warning screen if IE is detected. Though works fine, it shows the page first, on a weird factor (given it is IE), before proceeding the intended screen. The application is Reactive web by the way.

I thought initially it is due that the JS function is called on OnReady. When I moved it to OnInitialize, still does the same. Basically, it loads some elements of the page first before hitting that BrowserCheck function.

Any option I have? By the way, I am accessing the page via URL in an email so I can't pass a parameter before hand.

Thanks,

JC

Hi Juan,


Use a screen variable say IsIE (boolean) and set its value using the JavaScript out parameter.


On screen use the IsIE to determine your content 


However, there is one catch. Part of your screen shall still be rendered as shown in the screenshot below:

This is because your underlying layout will render its components even if your content is not loaded. To handle this you have to move your JS code to Layout used by the screen. To perform this:

Open the widget tree of the Screen and check the Layout used in the screen (LayoutTopMenu in my case)


Open LayoutTopMenu and check its widget tree


Use the previous JS and the IsIE variable to decide the if the main (highlighted above) or Content container or any other part of the layout to be rendered or not.


Hope this helps.

Regards,

Saugat


Actually, this is our current implementation. I have the browser checking in the layout itself. Problem is that it still load some part of the screen before redirecting to the other screen. Tried both OnReady and OnInitialize on the layout but still.

Juan Carlos Elorde wrote:

Actually, this is our current implementation. I have the browser checking in the layout itself. Problem is that it still load some part of the screen before redirecting to the other screen. Tried both OnReady and OnInitialize on the layout but still.


Hi Juan,


Please see the attached implementation. I have dome the following

1.  moved the OnInitialize action to LayoutTopMenu to hide the contents of the screen.

2. added exception handler to OnReady of the LayoutTopMenu so that any JS errors may should not be shown on the page

3. added external script file to validate browser and redirect

4. added external script to LayoutTopMenu as required scripts.

This is exactly what we have but still at a moment some parts of the screen show before moving to the new one. Anyway, we less prioritize this ticket and not sure if this will be a hard requirement on the new sprints. Thanks for the help sir!