4 Replies Latest reply on Oct 7, 2010 8:13 AM by rsurya

    Complete page reload with richfaces panel tag

    rsurya

      Hi,

      I am fairly new to Rich faces and while using it I came across an issue with the panel tag of the richfaces. The issue is that the default behaviour of this tag and probably of richfaces is to reload the page completely whenever a call to server is made through richfaces. When I went through the doc, I came across an attribute switchType="ajax". Setting of this attribute restricts the richfaces from reloading the whole page and instead loads only the selected section of the jsf page. Though this is available with certain richfaces objects like the tabs etc but may not be available with the panel tag. I checked the tag reference for this tag, panel, and it does not have the mentioned attribute, switchType, in its list. Some help here would be great, I dont want to reload the whole jsf and would like to stick to panel tag as it is being used at many places and a change would be very difficult.

      Thanks

        • 1. Re: Complete page reload with richfaces panel tag
          sivaprasad9394

          try adding

          a4j:region  to render only the specific region.

           

          <a4j:outputPanel ajaxRendered="true">
          <a4j:region id="postpaidCustomerRegion">

          1 of 1 people found this helpful
          • 2. Re: Complete page reload with richfaces panel tag
            rsurya

            Thanks Sivaprasad for replying but the solution you mentioned didnt work completely. Though it stopped the setting of other attributes in the associated model and that is good but the other main issue remains open. I have tried the following since my last post:

             

            1. a4j:region, to define the form elements which need to be processed. From the documentation I gathered that this tag defines the sections of the form which need to be processed instead of the whole form being processed. The latter being the default behaviour.
            2. a4j:outputPanel to define the sections where the ajax should refresh the output.
            3. a4j:support to define events, actions and rerender sections.

            None of the above worked. And as I saw in the application, after the action is executed on the server the whole jsf is refreshed which means each and every field is recreated/reloaded. There are 20 -25 fields on the page and some are dropdown and list boxes linked to heavy lookup methods. This is a serious performance issue.

             

            code snippet (Is there a way of pasting code on this forum? I had to retype the code below)

             

            <a4j:region id="regionId" renderRegiononly="true">

               <h:inputText value="...." id="...">

                 <a4j:support event="onchange" action="..." reRender="form:resolvedDescPanel" />

              </h:inputText>

            <a4j:region>

             

            <a4j:outputPanel ajaxRendered="true">

              <rich:panel header=".....">

                  <h:inputTextarea id="resolvedDescPanel" value="..." ...>

              </rich:panel>

            </a4j:outputPanel>

             

            Thanks in advance

            • 3. Re: Complete page reload with richfaces panel tag
              ilya_shaikovsky
              I came across an issue with the panel tag of the richfaces. The issue is that the default behaviour of this tag and probably of richfaces is to reload the page completely whenever a call to server is made through richfaces. 

              Hm.. panel component itself does not initiates any requests. Please show original code.

              • 4. Re: Complete page reload with richfaces panel tag
                rsurya

                Hi Ilya,

                That's correct the panel component by itself does not initiate any requests but it is mapped to the inputText object and this component uses a4j support to initiate an ajax request to the server and the output is displayed on the panel component. The code is pretty much what I use. On the server we have spring webflow actions which manage the flow. In the a4j:outputPanel mentioned in my code above, I think you can avoid the use of the ajaxRendered="true" as I have anyway used the reRender to map the component.