[jboss-user] [JBoss Seam] - Re: pages.xml action method fired on ajax requests - must be

gothmog do-not-reply at jboss.com
Mon Nov 5 16:59:43 EST 2007


I'm not too keen either, however the only scenario that I'm struggling to solve elegantly is the scenario where you have a page that can be navigated to in a number of ways and before you display that page you need the model to be setup correctly, i.e. you need to query something or change state in say a conversation before the page is rendered. And you can't rely on starting a conversation as you are already in one.

Now <page view-id="..." action="#{setupmethod}"> looks like a good candidate to centralise this behaviour, i.e. it doesn't matter how you get to this page you know the model is going to be 'prepared' for it in a pull manner. 

However you only want this to happen in two cases, the first time you land on the page and when the user refreshes the page (which is arguably re-landing on the same page). You don't want this code to run when you are interacting with the page. Now the traditional GET and POST solve this problem as you know where you are, but with restful urls this becomes difficult.

The only other way (I can think of) is to track all navigation requests to the page and call some setup code in a push manner (not as elegant and maintenance proof) and then redirect to the page and not use <page view-id="" action="#{setupMethod}"> at all. 

It was my understanding from reading the docu that the action method on the  element was designed for implementing some sort of MVP pattern?  





View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101986#4101986

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101986



More information about the jboss-user mailing list