Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-576

PopupSettings with no window name set generates invalid xhtml on Link

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0-beta1
    • 1.3.0-beta2
    • wicket
    • None
    • Linux Fedora Core 5, Firefox 2.0, Tomcat 5.23

    Description

      I've just switched my code over from 1.2 to 1.3 beta, and I'm running
      into a problem where Wicket seems to be generating invalid xhtml –
      specifically, it produces an href tag with a blank target attribute, as
      here:

      <a href="?wicket:interface=:6:rows:1:launch::ILinkListener:" target wicket:id="launch" onclick="var w = window.open(href, '', 'scrollbars=yes,location=no,menuBar=no,resizable=yes,status=no,toolbar=no'); if( w.blur) w.focus(); return false;">Launch</a>

      Notice right after the href="", there's a naked 'target' attribute. I'm
      guessing this is because the Link popupPageMap.getName () method is
      returning a null. Looks like the code checks to make sure that
      popupPageMap is NOT null, but it doesn't check getName().

      In the Wicket code I can see the following:

      <snip class=" org.apache.wicket.markup.html.link.Link" lines="460:467">
      if (popupSettings != null)
      {
      IPageMap popupPageMap = popupSettings.getPageMap(this);
      if (popupPageMap != null)

      { tag.put("target", popupPageMap.getName()); }

      }
      </snip>

      Here's my code:

      <snip>
      item.add(new Link("launch") {
      public void onClick()

      { setResponsePage(new LaunchFrameset()); }

      }.setPopupSettings(new
      PopupSettings(PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS)));
      </snip>

      If I add .setWindowName to my new PopupSettings object, everything seems
      to work. But I'm guessing it should work even if I forget to specify a
      window name.

      Attachments

        Activity

          People

            almaw Alastair Maw
            jrenfro James Renfro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: