On Thu, Jul 21, 2011 at 8:31 PM, Donohoe Digital <d...@donohoe.info> wrote: > I'm porting this sample scala/wicket application from Wicket 1.4 to 1.5. > I've almost completely got it figured out except for this bit of code from a > class that extends RequestCycle (it does some basic > EntityManager/Transaction stuff): > > override def onEndRequest = > { > super.onEndRequest() > if (em != null) > { > if (em.getTransaction().isActive()) em.getTransaction().commit() > em.close() > } > > // TODO: in 1.5 page maps no longer in use - not sure why they'd want to > do this to begin with... > // TODO: ahhh, maybe to prevent hitting 'back button'? > //if (_endConversation) getRequest().getPage().getPageMap().remove() > } > > > The line I have commented out at the end is what I can't find an equivalent > for in Wicket 1.5. > > Whether or not this is the proper way to do database stuff is really not > important to me - please don't let that distract from the question. For > those that are curious, the _endConversation flag is set in the body of a > form's onSubmit() method, after data is written to the database. > > What I'm really interested in is > > a) Why would someone want to remove the page map from the session in Wicket > 1.4? like above Is my comment correct that it prevents hitting the back > button and re-submitting a form?
i can only guess and say that all pages in the pagemap are part of the conversation and once the conversation is over/discarded the pagemap is removed so pages in that pagemap/conversation are no longer accessible. if the user tries to click back to a page and click any link on it they will get the page expired exception. > b) What is the Wicket 1.5 way of handling a situation like this? I looked > at some other related posts on these forums, but haven't found a good > description yet. dont think we have a replacement for this, actually. what we would need is ipagemanager#removePage(int id). that will only handle removing a single page though. if you have more pages that are part of a conversation you will have to track them all so the last page of the conversation knows all other pages that paricipated. this should be easy since somehow you must already be propagating the conversation somehow. then when conversation is over the code can access the list, from pages metadata?, and remove all pages. feel free to add an rfe for the remove() method. > c) In general, how does page caching work in Wicket 1.5? There isn't much > on the migrating wiki page... martin has already answered that in another email... -igor > > Thanks, > > -Doug > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/PageMap-in-1-5-tp3685858p3685858.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org