Wicket
  1. Wicket
  2. WICKET-4141

Automatic Linking in base page broken

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0, 1.5.1
    • Fix Version/s: 1.5.2
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Windows XP, Eclipse 3.7, Oracle JDK 6

      Description

      Automatic linking used in base pages is broken.

      The attached quickstart application contains a base page wicket.bugs.autolink.page.base.BasePage which has a relative image reference:
      <img src="theme/logo.png" border="1" width="50px" height="50px" />
      When accessing this page via http://localhost:8080/base the image is rendered as expected.
      The generated HTML output is:
      <img src="wicket/resource/wicket.bugs.autolink.page.base.BasePage/theme/logo-ver-1319028241918.png" border="1" width="50px" height="50px"/>

      The application contains a second page wicket.bugs.autolink.page.home.HomePage extending the BasePage.

      When accessing this page via http://localhost:8080/home the image inherited from the base page is not displayed.

      The inherited image reference is rendered as:
      <img src="theme/logo.png" border="1" onclick="window.location.href='theme/logo.png';return false;"/>
      => Problem 1: theme/logo.png is not autolinked anymore, it should point to wicket/resource/wicket.bugs.autolink.page.base.BasePage/theme/logo-ver-1319028241918.png
      => Problem 2: for some reasons a onclick event is rendered by Wicket

      I configured the Wicket app with:

      public void init()

      { super.init(); getMarkupSettings().setAutomaticLinking(true); getResourceSettings().setParentFolderPlaceholder("$up$"); mountPage("/home", HomePage.class); mountPage("/base", BasePage.class); }
      1. WICKET-4141.patch
        8 kB
        Andrea Del Bene
      2. WICKET-4141-autolink-bug.zip
        46 kB
        Johan

        Issue Links

          Activity

          Johan created issue -
          Hide
          Johan added a comment -

          wicket quickstart app

          Show
          Johan added a comment - wicket quickstart app
          Johan made changes -
          Field Original Value New Value
          Attachment WICKET-4141-autolink-bug.zip [ 12499675 ]
          Martin Grigorov made changes -
          Assignee Martin Grigorov [ mgrigorov ]
          Hide
          Andrea Del Bene added a comment -

          That's my proposed patch. I've inserted all informations about markup container and markup stream inside class PathInfo.

          Show
          Andrea Del Bene added a comment - That's my proposed patch. I've inserted all informations about markup container and markup stream inside class PathInfo.
          Andrea Del Bene made changes -
          Attachment WICKET-4141.patch [ 12499691 ]
          Martin Grigorov committed 1186265 (1 file)
          Reviews: none

          WICKET-4141 Automatic Linking in base page broken

          Try the parent container class if the needed package resource doesn't exist.

          Hide
          Martin Grigorov added a comment -

          Thanks Andrea, but I think mine solution is simpler

          Show
          Martin Grigorov added a comment - Thanks Andrea, but I think mine solution is simpler
          Martin Grigorov made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.5.2 [ 12318078 ]
          Resolution Fixed [ 1 ]
          Igor Vaynberg made changes -
          Summary Automatic Linking in base page broken Automatic Linking in base page broken [API BREAK IN AutoLinkResolver]
          Igor Vaynberg made changes -
          Summary Automatic Linking in base page broken [API BREAK IN AutoLinkResolver] Automatic Linking in base page broken
          Igor Vaynberg committed 1186275 (1 file)
          Reviews: none

          unroll andrea's patch, since martin added a less efficient but api-break-free fix
          Issue: WICKET-4141

          Igor Vaynberg made changes -
          Link This issue relates to WICKET-4145 [ WICKET-4145 ]
          Hide
          Andrea Del Bene added a comment -

          You are welcome!

          Show
          Andrea Del Bene added a comment - You are welcome!
          Martin Grigorov made changes -
          Link This issue breaks WICKET-4152 [ WICKET-4152 ]

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Johan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development