Loading Indicator Page Full Refresh in XPages

后端 未结 2 530
面向向阳花
面向向阳花 2021-01-24 09:01

One of my XPages there are mo many design elements. The page takes time to load more than expected according to connection speed. I would like to create an indicator to show the

2条回答
  •  自闭症患者
    2021-01-24 09:51

    How you do this will not be XPages-specific. It's important to understand the order of events.

    1. User clicks link somewhere to open page
    2. Browser sends request to server
    3. Server receives request and loads component tree for page server-side
    4. Server runs beforePageLoad, afterPageLoad, beforeRenderResponse events
    5. Server generates HTML to send to the browser
    6. Server runs afterRenderResponse event
    7. Server passes resulting HTML to the screen
    8. Browser receives response from server

    So adding anything to the XPage that is the target of the browser request at step 2 cannot have an effect. You need to do something client-side at step 1, before the request is sent to the browser. If you think about how you did it for the partial refresh and what's happening, again it's running CSJS before triggering the partial refresh, the same process.

    If users are coming externally, the only option is to send them to a redirect web page first, render that, and continue programmatically running step 1.

提交回复
热议问题