You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org> on 2012/01/27 14:13:39 UTC

[jira] [Resolved] (WICKET-4360) Wicket reloading old page id on page refresh

     [ https://issues.apache.org/jira/browse/WICKET-4360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4360.
-------------------------------------

    Resolution: Not A Problem

On F5 Wicket reads (once) the current page.
But then it writes a the page with a new page id because of the usage of ListView (PropertyListView in DataPanel).
By adding "commentsListView.setReuseItems(true);" all is fine.
See WICKET-4286 for a discussion about the ListView problem. 
                
> Wicket reloading old page id on page refresh
> --------------------------------------------
>
>                 Key: WICKET-4360
>                 URL: https://issues.apache.org/jira/browse/WICKET-4360
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows & linux, jetty 7 & WAS 7
>            Reporter: Stijn Geukens
>         Attachments: wicket4360.zip
>
>
> This issue was first reported on StackOverflow but after further investigation it is possible that this is a bug:
> http://stackoverflow.com/questions/8985785/wicket-serialization-deserialization-issue
> I added following to my Page class:
> 	private void writeObject(ObjectOutputStream oos) throws IOException {
> 		oos.defaultWriteObject();
> 		System.err.println("Writing " + this + something to print out the type of the filter);
> 	}
> 	private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
> 		ois.defaultReadObject();
> 		System.err.println("Reading " + this + something to print out the type of the filter); 
> 	}
> 1. When the Page is loaded first it prints (actually it prints this 5 times, not sure if it's normal):
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 2. When I click on AjaxLink 'ALL' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 3. When I click on AjaxLink 'DISCUSSIONS' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> 4. When I refresh the page (F5) the pageid is updated:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 2]: type = DISCUSSIONS
> The url however does not change, it stays http://.../?0
> 5. When I click on AjaxLink 'ALL' (that will update the filter) it prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 1]: type = ALL
> So far so good but
> 6. When I refresh the page now (F5) this is printed out:
> Reading [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 2, render count = 2]: type = DISCUSSIONS
> So it deserializes the page with id 0 although the last known page id was 1 and all changes that were done for version 1 are ignored (in this case switching the type from DISCUSSIONS to ALL).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira