1 Reply Latest reply on May 7, 2009 7:53 PM by nbelaevski

    performance sending components  inside rich:modalPanel

    juangon

      I have some rich:modalPanel (in my case are draggable rich:panel but I suppose this are equivalent for my question) with an outer h:form .

      What is the correct way to guarantee only the rich:modalPanel form is send and processed?

      After reading many tutorials and forums about richfaces, I came across this conclusions (please tell me if I am wrong in anything):

      * <a4j:region/> is to separate the h:form components processing if there is an AJAX request.
      * <h:form/> is used to limit the components sent to server.
      * "process" and "ajaxSingle": same as a4j:region but for only one component (and process other components).
      * limitToList: tells what components are to be re-rendered. Don't know exactly if this also affects the form components to be sent and/or components to be processed in server.

      I guess the best way to guarantee that only the form components are sent and processed is to have something like this:

      <h:form>
       <rich:panel>
       <f:facet name="header">
       ....
       </f:facet>
       <h:inputText id="text1" />
      <h:inputText id="text2"/>
      <a4j:commandButton actionListener="#{.....}" limitToList="true" reRender="text1,text2" value="Save"/>
      </rich:panel>
      </h:form>
      


      I have an xhtml (Facelets) page with many ajax components, and I woud like to increase performance by making sure only the form components inside rich:panels are sent and processed.

      Thanks very much for your attention!

        • 1. Re: performance sending components  inside rich:modalPanel
          nbelaevski

           

          * <a4j:region/> is to separate the h:form components processing if there is an AJAX request.

          a4j:region serves to limit processing of component tree on the server on 2-5 phases.
          Note: a4j:region does not limit partial rendering by default (see "renderRegionOnly" attribute).
          * <h:form/> is used to limit the components sent to server.

          Note: hidden field containing view state is rendered for each form. So for client state saving and multiple forms, amount of generated HTML code can be large.
          * limitToList: tells what components are to be re-rendered. Don't know exactly if this also affects the form components to be sent and/or components to be processed in server.

          AJAX output components have "ajaxRendered" attribute. When it is true, this component will be updated on each request, even if it is not declared in the "reRender" attribute of component initiating the event (e.g. a4j:commandLink). Setting limitToList=true disables this behavior, only components explicitly specified in "reRender" attribute will be updated.

          About modal panels. Each rich:modalPanel has to have own form inside (unless "domElementAttachment" attribute specified - more info in docs). Forms MUST NOT be nested - JSF prohibits this.

          Please ask more if you need additional info/some clarification.