You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Luther Baker <lu...@gmail.com> on 2009/05/31 18:06:16 UTC

Does Link work with browser BACK button?

For this example, I have a 'blog' like front page. On this page are several
posts that each, have an associated category and multiple tags.

I am in the prototype/design phase right now (simply hard coding the posts
and corresponding references in the Java class).

*Use Case 1:
*1. visit the front page and click on a 'category' link (correctly takes me
to the 'CategoryPage').
2. from the 'CategoryPage', click on the 'Home' link (correctly takes me
back to the front page).
3. from font page, click on any of the three 'category' links (correctly
takes me to the 'CategoryPage').

*Use Case 2:
*1. visit the front page and click on a 'category' link (correctly takes me
to the 'CategoryPage').
2. from the 'CategoryPage', click *BACK BUTTON in the browser*
3. from font page, click on any of the three 'category' links (crash!)

Page Expired

The page you requested has expired.

Return to home page <http://localhost:8089/effprog/>


Thanks,

-Luther



*Code*

*Relevant markup:
*
        <dl class="post">
            <dt class="title"><h4>Wicket and Legos</h4></dt>
            <dd class="tags"><strong><a href="#"
wicket:id="a-category-2">[web frameworks]</a></strong>: wicket</dd>
            <dd class="content">
                Wicket makes things so easy.
                Make a change and you can see all the obvious things break.
                Its much more like putting together a lego set.
                Things just fit into place.
            </dd>
            <dd class="dateline">2009/05/26 Luther Baker</dd>
        </dl>

*and the Java:
*
    public HomePage()
    {
        super(new ResourceModel("head-title"));

        Category category = new Category();
        category.setName("web-frameworks");
        addCategoryLink("a-category-1", category);
        addCategoryLink("a-category-2", category);

        category = new Category();
        category.setName("mac-desktop");
        addCategoryLink("a-category-3", category);
    }

    private void addCategoryLink(final String key, final Category category)
    {
        final Link<Void> link = new Link<Void>(key)
        {
            private static final long serialVersionUID = 1L;

            @Override
            public void onClick()
            {
                final CategoryPage categoryPage = new
CategoryPage(category);
                setResponsePage(categoryPage);
            }
        };
        add(link);
    }

Re: Does Link work with browser BACK button?

Posted by Luther Baker <lu...@gmail.com>.
Ah - thanks both of you. Category was still pretty much a POJO


     @Entity
     public class Category
     {


*This fixed it:*


    @Entity
    public class Category implements Serializable
    {
        private static final long serialVersionUID = 1L;



Thanks,

-Luther




On Sun, May 31, 2009 at 11:20 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> agreed it sounds like a serialization error, check your logs. webpage
> is already serializable so no need to do it there. something else you
> are holding a reference to must not be serializable.
>
> -igor
>
> On Sun, May 31, 2009 at 9:11 AM, joeinazusa <hi...@gmail.com> wrote:
> >
> > Yes it does.
> >
> > Sounds like to you need to implement serializable in your class.
> >
> >
> > public class YourClass extends WebPage implements Serializable {
> >
> >
> >
> > luther.baker wrote:
> >>
> >> For this example, I have a 'blog' like front page. On this page are
> >> several
> >> posts that each, have an associated category and multiple tags.
> >>
> >> I am in the prototype/design phase right now (simply hard coding the
> posts
> >> and corresponding references in the Java class).
> >>
> >> *Use Case 1:
> >> *1. visit the front page and click on a 'category' link (correctly takes
> >> me
> >> to the 'CategoryPage').
> >> 2. from the 'CategoryPage', click on the 'Home' link (correctly takes me
> >> back to the front page).
> >> 3. from font page, click on any of the three 'category' links (correctly
> >> takes me to the 'CategoryPage').
> >>
> >> *Use Case 2:
> >> *1. visit the front page and click on a 'category' link (correctly takes
> >> me
> >> to the 'CategoryPage').
> >> 2. from the 'CategoryPage', click *BACK BUTTON in the browser*
> >> 3. from font page, click on any of the three 'category' links (crash!)
> >>
> >> Page Expired
> >>
> >> The page you requested has expired.
> >>
> >> Return to home page <http://localhost:8089/effprog/>
> >>
> >>
> >> Thanks,
> >>
> >> -Luther
> >>
> >>
> >>
> >> *Code*
> >>
> >> *Relevant markup:
> >> *
> >>         <dl class="post">
> >>             <dt class="title"><h4>Wicket and Legos</h4></dt>
> >>             <dd class="tags"><strong> # [web frameworks] </strong>:
> >> wicket</dd>
> >>             <dd class="content">
> >>                 Wicket makes things so easy.
> >>                 Make a change and you can see all the obvious things
> >> break.
> >>                 Its much more like putting together a lego set.
> >>                 Things just fit into place.
> >>             </dd>
> >>             <dd class="dateline">2009/05/26 Luther Baker</dd>
> >>         </dl>
> >>
> >> *and the Java:
> >> *
> >>     public HomePage()
> >>     {
> >>         super(new ResourceModel("head-title"));
> >>
> >>         Category category = new Category();
> >>         category.setName("web-frameworks");
> >>         addCategoryLink("a-category-1", category);
> >>         addCategoryLink("a-category-2", category);
> >>
> >>         category = new Category();
> >>         category.setName("mac-desktop");
> >>         addCategoryLink("a-category-3", category);
> >>     }
> >>
> >>     private void addCategoryLink(final String key, final Category
> >> category)
> >>     {
> >>         final Link<Void> link = new Link<Void>(key)
> >>         {
> >>             private static final long serialVersionUID = 1L;
> >>
> >>             @Override
> >>             public void onClick()
> >>             {
> >>                 final CategoryPage categoryPage = new
> >> CategoryPage(category);
> >>                 setResponsePage(categoryPage);
> >>             }
> >>         };
> >>         add(link);
> >>     }
> >>
> >>
> >
> > --
> > View this message in context:
> http://www.nabble.com/Does-Link-work-with-browser-BACK-button--tp23804447p23804483.html
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Does Link work with browser BACK button?

Posted by Igor Vaynberg <ig...@gmail.com>.
agreed it sounds like a serialization error, check your logs. webpage
is already serializable so no need to do it there. something else you
are holding a reference to must not be serializable.

-igor

On Sun, May 31, 2009 at 9:11 AM, joeinazusa <hi...@gmail.com> wrote:
>
> Yes it does.
>
> Sounds like to you need to implement serializable in your class.
>
>
> public class YourClass extends WebPage implements Serializable {
>
>
>
> luther.baker wrote:
>>
>> For this example, I have a 'blog' like front page. On this page are
>> several
>> posts that each, have an associated category and multiple tags.
>>
>> I am in the prototype/design phase right now (simply hard coding the posts
>> and corresponding references in the Java class).
>>
>> *Use Case 1:
>> *1. visit the front page and click on a 'category' link (correctly takes
>> me
>> to the 'CategoryPage').
>> 2. from the 'CategoryPage', click on the 'Home' link (correctly takes me
>> back to the front page).
>> 3. from font page, click on any of the three 'category' links (correctly
>> takes me to the 'CategoryPage').
>>
>> *Use Case 2:
>> *1. visit the front page and click on a 'category' link (correctly takes
>> me
>> to the 'CategoryPage').
>> 2. from the 'CategoryPage', click *BACK BUTTON in the browser*
>> 3. from font page, click on any of the three 'category' links (crash!)
>>
>> Page Expired
>>
>> The page you requested has expired.
>>
>> Return to home page <http://localhost:8089/effprog/>
>>
>>
>> Thanks,
>>
>> -Luther
>>
>>
>>
>> *Code*
>>
>> *Relevant markup:
>> *
>>         <dl class="post">
>>             <dt class="title"><h4>Wicket and Legos</h4></dt>
>>             <dd class="tags"><strong> # [web frameworks] </strong>:
>> wicket</dd>
>>             <dd class="content">
>>                 Wicket makes things so easy.
>>                 Make a change and you can see all the obvious things
>> break.
>>                 Its much more like putting together a lego set.
>>                 Things just fit into place.
>>             </dd>
>>             <dd class="dateline">2009/05/26 Luther Baker</dd>
>>         </dl>
>>
>> *and the Java:
>> *
>>     public HomePage()
>>     {
>>         super(new ResourceModel("head-title"));
>>
>>         Category category = new Category();
>>         category.setName("web-frameworks");
>>         addCategoryLink("a-category-1", category);
>>         addCategoryLink("a-category-2", category);
>>
>>         category = new Category();
>>         category.setName("mac-desktop");
>>         addCategoryLink("a-category-3", category);
>>     }
>>
>>     private void addCategoryLink(final String key, final Category
>> category)
>>     {
>>         final Link<Void> link = new Link<Void>(key)
>>         {
>>             private static final long serialVersionUID = 1L;
>>
>>             @Override
>>             public void onClick()
>>             {
>>                 final CategoryPage categoryPage = new
>> CategoryPage(category);
>>                 setResponsePage(categoryPage);
>>             }
>>         };
>>         add(link);
>>     }
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Does-Link-work-with-browser-BACK-button--tp23804447p23804483.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Does Link work with browser BACK button?

Posted by joeinazusa <hi...@gmail.com>.
Yes it does.

Sounds like to you need to implement serializable in your class.


public class YourClass extends WebPage implements Serializable {



luther.baker wrote:
> 
> For this example, I have a 'blog' like front page. On this page are
> several
> posts that each, have an associated category and multiple tags.
> 
> I am in the prototype/design phase right now (simply hard coding the posts
> and corresponding references in the Java class).
> 
> *Use Case 1:
> *1. visit the front page and click on a 'category' link (correctly takes
> me
> to the 'CategoryPage').
> 2. from the 'CategoryPage', click on the 'Home' link (correctly takes me
> back to the front page).
> 3. from font page, click on any of the three 'category' links (correctly
> takes me to the 'CategoryPage').
> 
> *Use Case 2:
> *1. visit the front page and click on a 'category' link (correctly takes
> me
> to the 'CategoryPage').
> 2. from the 'CategoryPage', click *BACK BUTTON in the browser*
> 3. from font page, click on any of the three 'category' links (crash!)
> 
> Page Expired
> 
> The page you requested has expired.
> 
> Return to home page <http://localhost:8089/effprog/>
> 
> 
> Thanks,
> 
> -Luther
> 
> 
> 
> *Code*
> 
> *Relevant markup:
> *
>         <dl class="post">
>             <dt class="title"><h4>Wicket and Legos</h4></dt>
>             <dd class="tags"><strong> # [web frameworks] </strong>:
> wicket</dd>
>             <dd class="content">
>                 Wicket makes things so easy.
>                 Make a change and you can see all the obvious things
> break.
>                 Its much more like putting together a lego set.
>                 Things just fit into place.
>             </dd>
>             <dd class="dateline">2009/05/26 Luther Baker</dd>
>         </dl>
> 
> *and the Java:
> *
>     public HomePage()
>     {
>         super(new ResourceModel("head-title"));
> 
>         Category category = new Category();
>         category.setName("web-frameworks");
>         addCategoryLink("a-category-1", category);
>         addCategoryLink("a-category-2", category);
> 
>         category = new Category();
>         category.setName("mac-desktop");
>         addCategoryLink("a-category-3", category);
>     }
> 
>     private void addCategoryLink(final String key, final Category
> category)
>     {
>         final Link<Void> link = new Link<Void>(key)
>         {
>             private static final long serialVersionUID = 1L;
> 
>             @Override
>             public void onClick()
>             {
>                 final CategoryPage categoryPage = new
> CategoryPage(category);
>                 setResponsePage(categoryPage);
>             }
>         };
>         add(link);
>     }
> 
> 

-- 
View this message in context: http://www.nabble.com/Does-Link-work-with-browser-BACK-button--tp23804447p23804483.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org