Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5906

external link and zk event race condition for timeout redirect

XMLWordPrintable

    • None

      Steps to reproduce

      https://zkfiddle.org/sample/15ntp3u/4-ZK-event-on-href-unload-session-timeout
      Copy to a local project with timeout redirect
      Click on the link

      Current result

      depending on event order, you may be redirected to the href target, or to the timeout page if timeout page is enabled
      if timeout page is not enabled, you may see the timeout popup before navigation

      Expected result

      ZK timeouts shouldn't interfere with an external navigation event

      Debug Information

      Caused by href onBeforeUnload racing with the onClick (or other ZK event triggered by same click)
      If rmDesktop is complete by the time the click event is being processed, timeout will be returned instead

      Workaround

      -

      Original ticket below

      Steps to Reproduce

      1. Create a Tree component that has one Treecol, one Treerow with one Treecell.
      2. Iinside the Treecell create an Anchor (A) component that has a href="" attribute with a link value.
      3. Inside the Anchor, create a Div component. It can be empty or it can contain a Label. My example contains a Label because I need it for my work.
      4. After the Tree component is rendered in the Browser, click on the Anchor Link from the Tree component.

      I have used the Tree model example from the ZK Demo page to demonstrate the Bug and created a ZK fiddle: https://zkfiddle.org/sample/60j3hk/3-Tree-that-contains-Anchor-with-Div-session-timeout-Bug 

      <a href="https://www.zkoss.org/zkdemo/tree/tree_model">
            <div>
              <label value="Test outside of Tree - works!"/>
            </div>
      </a>      
      
      <tree id="tree" hflex="1" model="${$composer.treeModel}">
              <treecols>
                  <treecol hflex="1" label="Path" />
              </treecols>
              <template name="model">
                  <treeitem>
                      <treerow>
                          <treecell>
                            <a href="https://www.zkoss.org/zkdemo/tree/tree_model">
                              <div>
                                  <label value="${each.data.path}"/>
                              </div>                        
                            </a>
                          </treecell>
                      </treerow>
                  </treeitem>
              </template>
          </tree> 

      Current Result

             Application Session-Timeout occurs in the browser (depending on your timeout configs, it can redirect you to a timeout page, or to existing page).

      Expected Result

           The Anchor Link should be loaded in the browser.

      Debug Information

      N.a.    

      Workaround

      N.a.

            Jenkins Jenkins
            idri idri
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: