3 Replies Latest reply on Nov 18, 2013 8:42 PM by Brian Leathem

    binding causes the page to reload

    Sushant Saini Novice

      I am currently migrating from JSF 1.2/Richfaces 3.3.3. to JSF 2/Richfaces 4.3.2.  I have noticed that on all of my pages if i have a single binding it cuases my page to reload on every ajax call. As soon as i remove the binding, reloading stops. I cannot get rid of all the bindings as there are too many of them. Is there any other way to fix this problem?

        • 2. Re: binding causes the page to reload
          Sushant Saini Novice

          Hi Brian,

          I have created a simple example below to show the issue but the fact is that I am currently migrating an 3.3.3 applications to 4.3.2 and my applications has more then hundred pages and we have seen this issue across all the pages. The moment we remove all the bindings from the page, reloading stops and moment we add even 1 binding back, it causes the reloading. 3 developers on my team has confirmed the same.


          Please please help me!!! I need to finish upgrading really soon and our application relies on binding extensively.


          I have create the simplest example to show this issue. Try putting a break point in init() method and click on the numbers in datatable, you will see init being called again. Then remove the binding and try again, you will see init will not be invoked when you click on numbers. The bean is in view scope.


          Here is my test.xhtml


          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          <html xmlns="http://www.w3.org/1999/xhtml"
                      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                      <link rel="stylesheet" type="text/css" href="css/star-skin2.css" />
            <rich:dataTable value="#{testBean.employeeList}" var="arr" binding="#{testBean.datatable}"
               render="lowerScroller,upperScroller" >
            <rich:column sortBy="#{arr.address}"   sortOrder="#{testBean.locationsrtOdr}"  >
                      <f:facet name="header">
                      <a4j:commandLink value="Loc Code" render="searchResultsTable,bldtooltip,bldlocQuickPeek" action="#{testBean.locationSort}" style="xls-font-bold:true" />
                      <a4j:commandLink value="#{arr.address}"  action="#{testBean.onLocationClick()}" />

          Here is the  my TestBean.java


          package gov.gsa.pbs.rexus.community.view.bean;
          import gov.gsa.pbs.rexus.common.dto.AddressDTO;
          import java.util.ArrayList;
          import java.util.List;
          import javax.annotation.PostConstruct;
          import org.richfaces.component.SortOrder;
          import org.richfaces.component.UIDataTable;
          public class TestBean {
            private SortOrder locationsrtOdr = SortOrder.unsorted;
            public SortOrder getLocationsrtOdr() {
            return locationsrtOdr;
            public void setLocationsrtOdr(SortOrder locationsrtOdr) {
            this.locationsrtOdr = locationsrtOdr;
            private List<AddressDTO> employeeList;
            UIDataTable  datatable;
            public UIDataTable getDatatable() {
            return datatable;
            public void setDatatable(UIDataTable datatable) {
            this.datatable = datatable;
            public List<AddressDTO> getEmployeeList() {
            return employeeList;
            public void setEmployeeList(List<AddressDTO> employeeList) {
            this.employeeList = employeeList;
            public void init() {
            employeeList = new ArrayList<AddressDTO>();
            for(int i=0;i<10;i++)
            AddressDTO addressDTO = new AddressDTO();
            addressDTO.setAddress("" + i);
            public void locationSort() {
            if (locationsrtOdr.equals(SortOrder.ascending)) {
                  } else {
            public String onLocationClick()
            return null;

          Let me know if you need anything else.

          • 3. Re: binding causes the page to reload
            Brian Leathem Master

            Is this problem unique to using the view scope?  If you change to Session scope, does the binding work as expected? (just as a check).


            Sounds like you might be hitting https://java.net/jira/browse/JAVASERVERFACES-1492, for which the accepted workaround is to set javax.faces.PARTIAL_STATE_SAVING to false.