[jboss-dev-forums] [Design of JBoss Portal] - Re: JBOSS Portal, JSF, XHTML and AJAX !!!finally!!! :-)
dajevtic
do-not-reply at jboss.com
Wed Sep 6 07:50:56 EDT 2006
Current lifecycle is:
I create an XMLHttpRequest and send it to the portal servlet (either action=2 for simple rendering or action=1 for applying my form values and then retrieving results). In order for the portal servlet to know if it is an ajax request it looks for a request parameter (I called it "lmgajax"). If this request parameter exists then a PortalRequest constructor with isAjax=true is called and then InvokeWindowActionCommand with isAjax is called. Based on that I let the portal do everything else. At the end the InvokeWindowActionCommand instantiates a InvokeWindowRenderCommand (also with ajax=true) in the constructor. When the RenderContext is activated for rendering the page, it checks if it was invoked from an Ajax request. If so, then only the portlet that triggered the Ajax is rendered with decorator = emptyRenderer. The request sent back is then only the inner HTML of the portlet that created the request. That is basically it.
Now I (additionally) want to add some goodies like I mentioned, e.g. specify a target portlet.
For now, any portlet can create an AJAX request sending all its form elements within the AJAX request and be rerendered.
Sorry if I confused you, but it does indeed work on any portlet that sends out an Ajax-Request. Only prerequisite is that the request contains a parameter "lmgajax". lmg being my companies initials, but I don't insist on calling the parameter like that. I could be also "jbossajax" or anything you like. The PortalServlet just needs to know, so we can have that parameter name configured in web.xml...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969708#3969708
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969708
More information about the jboss-dev-forums
mailing list