can't reproduce it.
I altered as you did i think:

added onBeginRequest to the to the NonBookmarkablePage
changed PageLinkPage to use this construct:
add(new PageLink("pageLink", new NonBookmarkablePage(this)));

instead of the lazy init page construct

set a breakpoint on the onBeginRequest and clicked on the link
only hit once.

johan


On 3/2/06, R.A <[EMAIL PROTECTED]> wrote:

Hi Johan,

The same thing occurred in Wicket Examples.
I added System.out.println in NonBookmarkablePage.

* wicket.examples.compref.NonBookmarkablePage
public class NonBookmarkablePage extends WebPage
{
    /**
     * Constructor.
     * @param referer the refering page
     */
    public NonBookmarkablePage(final WebPage referer)
    {
        if (referer == null)
        {
                throw new IllegalArgumentException("Argument referer must not be
null");
        }

        // Add a link to navigate back to the refering page. We now use the
PageLink
        // constructor with the Page instance argument, because we allready
have a page instance
        // at our disposal
        add(new PageLink("navigateBackLink", referer));

        // Note that this would have had the same effect
                //
                //  add(new Link("navigateBackLink")
                //  {
                //        public void onClick()
                //        {
                //                setResponsePage(referer);
                //        }
                //  });
        }

        // add
        protected void onBeginRequest() {
                System.out.println("Entering on BeginRequest");
        }
}

And original PageLinkPage code is here.

* wicket.examples.compref.PageLinkPage
public class PageLinkPage extends WicketExamplePage
{
    /**
     * Constructor
     */
    public PageLinkPage()
    {
                add(new PageLink("pageLink", new IPageLink()
                {
                        public Page getPage()
                        {
                                return new NonBookmarkablePage(PageLinkPage.this);
                        }

                        public Class getPageIdentity()
                        {
                                return NonBookmarkablePage.class;
                        }
                }));
        }
}

And I accessed Wicket Examples -> complef ->
wicket.markup.html.link.PageLink -> go to our private/ non bookmarkable
page, logs are made to output as follows.

[06/03/02 19:12:30:203 JST] 1d54d85e SystemOut     O Entering onBeginRequest

onBeginRequest was called one time.

Then I changed PageLinkPage as follows.

public class PageLinkPage extends WicketExamplePage
{
    /**
     * Constructor
     */
    public PageLinkPage()
    {
/*
                add(new PageLink("pageLink", new IPageLink()
                {
                        public Page getPage()
                        {
                                return new NonBookmarkablePage( PageLinkPage.this);
                        }

                        public Class getPageIdentity()
                        {
                                return NonBookmarkablePage.class;
                        }
                }));
*/
                // add
                add(new PageLink("pageLink", new NonBookmarkablePage(this)));
        }
}

And I accessed Wicket Examples again, logs as follows.

Entering on BeginRequest
[06/03/02 19:22:46:625 JST]  ae46607 SystemOut     O Entering onBeginRequest

onBeginRequest was called two times.

Thank you.
R.A
--
View this message in context: http://www.nabble.com/PageLink-called-request-two-times-t1205926.html#a3199970
Sent from the Wicket - User forum at Nabble.com.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to