Wicket
  1. Wicket
  2. WICKET-206

Default page map is null, should be set to something more usable

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.4
    • Fix Version/s: 1.4.11, 1.5-M2.1
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      JBoss, windows 2k

      Description

      Related to thread : http://www.nabble.com/From-pop-up%2C-page-link-to-change-the-parent-wihtout-changing-the-popup-tf2966574.html

      Problem is to open a pop-up and change page in the calling page. To do that, we used BookmarkablePageLink. This one need to set a PageMap and set the attribute target to the page map of the calling page.

      When in the calling page, you can get the pageMap name by doing a : getPage().getPageMap().getName().
      the problem is that the default page map have a name set to null by default. this can be resolved (I Think, but not sure) by changing the DEFAULT_NAME in PageMap to something else than null. The other possibility is to add a method in webpage called getwindowname() that would return the window name, which is the default name for the default pageMap.

        Activity

        Hide
        Johan Compagner added a comment -

        i didn't follow the complete thread, but why is it a problem exactly that the default pagemap is null?
        Why don't you just use PopupSettings when you want to open a popup from a link??

        Show
        Johan Compagner added a comment - i didn't follow the complete thread, but why is it a problem exactly that the default pagemap is null? Why don't you just use PopupSettings when you want to open a popup from a link??
        Hide
        Marc-Andre Houle added a comment -

        The problem was that I wanted the pop-up window to change the page displayed in the main window(the one that open the pop-up)
        Because of the null name, the window.name and the pagemap name was not in synched and the window.name is "hardcoded" to wicket:default. I think that it should not do an hard-code to set the window name since everywhere else, the window.name is the same as the pagemap name.

        I don't know if you follow me. If not, I'll provide more details. This is not directly a problem, it is just inconsistent with the window.name value....

        See this page for a code example :
        http://cwiki.apache.org/WICKET/how-to-redirect-page-from-a-pop-up.html

        Show
        Marc-Andre Houle added a comment - The problem was that I wanted the pop-up window to change the page displayed in the main window(the one that open the pop-up) Because of the null name, the window.name and the pagemap name was not in synched and the window.name is "hardcoded" to wicket:default. I think that it should not do an hard-code to set the window name since everywhere else, the window.name is the same as the pagemap name. I don't know if you follow me. If not, I'll provide more details. This is not directly a problem, it is just inconsistent with the window.name value.... See this page for a code example : http://cwiki.apache.org/WICKET/how-to-redirect-page-from-a-pop-up.html
        Hide
        Marc-Andre Houle added a comment -

        It is a problem for exemple in BookmarkablePageLink.

        See code paste bellow :
        /**

        • @param pageMap
        • The pagemap for this link's destination
        • @return This
          */
          public final BookmarkablePageLink setPageMap(final IPageMap pageMap)
          Unknown macro: { if (pageMap != null) { this.pageMapName = pageMap.getName(); add(new AttributeModifier("target", false, new Model(pageMapName))); } return this; }

          /**

        • @return Page map for this link
          */
          public final IPageMap getPageMap()
          Unknown macro: { if (pageMapName != null) { return PageMap.forName(pageMapName); } else { return getPage().getPageMap(); } }

        In that, you can see that when PageMap name is null, it does not do what is expected. Presently, it is making me big problem exactly because the pageMap name is null and then did not return the correct page map.

        Show
        Marc-Andre Houle added a comment - It is a problem for exemple in BookmarkablePageLink. See code paste bellow : /** @param pageMap The pagemap for this link's destination @return This */ public final BookmarkablePageLink setPageMap(final IPageMap pageMap) Unknown macro: { if (pageMap != null) { this.pageMapName = pageMap.getName(); add(new AttributeModifier("target", false, new Model(pageMapName))); } return this; } /** @return Page map for this link */ public final IPageMap getPageMap() Unknown macro: { if (pageMapName != null) { return PageMap.forName(pageMapName); } else { return getPage().getPageMap(); } } In that, you can see that when PageMap name is null, it does not do what is expected. Presently, it is making me big problem exactly because the pageMap name is null and then did not return the correct page map.
        Hide
        Eelco Hillenius added a comment -

        Assigned version (beta 4)

        Show
        Eelco Hillenius added a comment - Assigned version (beta 4)
        Hide
        Johan Compagner added a comment -

        moved to 1.4. We should look if we really still need this or if we are going to change the PageMap thing all together.

        Show
        Johan Compagner added a comment - moved to 1.4. We should look if we really still need this or if we are going to change the PageMap thing all together.
        Hide
        Juergen Donnerstag added a comment -

        Code has been completely reworked in 1.5
        In 1.4.10 the code is still the same but nobody else seems to have that issue

        Show
        Juergen Donnerstag added a comment - Code has been completely reworked in 1.5 In 1.4.10 the code is still the same but nobody else seems to have that issue

          People

          • Assignee:
            Johan Compagner
            Reporter:
            Marc-Andre Houle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development