Hi,

I'm trying to use the InspectorBug in wicket 1.3.5. I extracted it from the
wicket-examples source code.
The problem is, every page is treated as stateless, soI can get no
information on component's models. I get info on Application and Session,
but about the Pages, debugging through the code I find out that the problem
is that the page never gets an Id (Page.getId()) so the IPageMapEntry can be
retrieved...

public InspectorBug(final String id, final WebPage page)
    {
        super(id);
        PageParameters parameters = new PageParameters();
        parameters.put("pageId", page.getId());
        Link link = new BookmarkablePageLink("link", InspectorPage.class,
parameters);
        link.add(new Image("bug"));
        add(link);
    }

public InspectorPage(final PageParameters parameters)
    {
        add(new ApplicationView("application", Application.get()));
        add(new SessionView("session", Session.get()));
        IPageMapEntry entry = null;
        try
        {
            entry = getPageMap().getEntry(parameters.getInt("pageId"));
        }
        catch (StringValueConversionException e)
        {
            // Ignore
        }
        add(new PageView("page", entry == null ? null : entry.getPage()));
        add(new Image("bug"));
        add(new BookmarkablePageLink("allsessions",
LiveSessionsPage.class));
        add(new Label("wicketVersion",
getApplication().getFrameworkSettings().getVersion()));
    }

I also noticed that Page.setId() is only called when the Page is put into
the PageMap (which makes sense, and is also stated by the comments on Page's
constructors)
"        // A Page's id is not determined until setId is called when the
Page is
        // added to a PageMap in the Session."

I suppose this is not working because in InspectorBug's construction, the
page isn't in the pagemap yet, so it has no id.
Is there any workaround to get the InspectorBug panel working ?

Cheers,
Xavier

Reply via email to