3 Replies Latest reply on Apr 9, 2010 7:21 AM by t3chi3

    Preventing full refresh of data table

      The behavior as of now is that if I go towards the bottom of the page and update a cell I will get a full refresh and be brought to the top of the page again no matter what I try to do in code to prevent it.  I am using Spring Webflow so I can't discount that as the culprit but here is my code if anyone has some ideas.

       

      <ui:define name="content" switchType="ajax">

      <rich:tabPanel>

      <rich:tab rendered="#{buildingResourcesModel.seriesCount>=1}" label="#{buildingResourcesModel.seriesHeadings[0]}" switchType="ajax">

      <a4j:support event="onClick" action="active-tab">

      <a4j:actionparam name="active_tab" value="1" />

      </a4j:support>

      <f:view>

      <h:form id="tab1">

      <ui:fragment id="fragment">

          <rich:dataTable rows="24"

               value="#{buildingResourcesModel.seriesSets[0]}" var="time" rowKeyVar="row"

               rowClasses="row1, row2"

               columnClasses="column1"

               cellpadding="0">

       

      <rich:column>

      <f:facet name="header"><h:outputText value="Period Ending" /></f:facet>

      <h:outputText value="#{time[0].seriesDisplay}" />

      </rich:column>

       

      <rich:columns value="#{buildingResourcesModel.columnSets[0]}" var="column" index="ind">

      <f:facet name="header"><h:outputText value="#{column.header}" /></f:facet>

       

      <a4j:outputPanel id="C_#{ind}">

      <h:inputText rendered="#{time[ind].forecastType==2}" styleClass="editable-cell-forecast" value="#{time[ind].availability}">

      <a4j:support event="onchange" action="save" reRender="tab1:j_id38:#{row}:C_#{ind}" ajaxSingle="true">

      <a4j:actionparam name="guid" value="#{time[ind].guid}" />

      <a4j:actionparam name="row" value="#{row}" />

      <a4j:actionparam name="col" value="#{ind}" />

      </a4j:support>

      </h:inputText>

       

      <h:inputText rendered="#{time[ind].forecastType!=2}" styleClass="editable-cell" value="#{time[ind].availability}">

      <a4j:support event="onchange" action="save" reRender="tab1:j_id38:#{row}:C_#{ind}" ajaxSingle="true">

      <a4j:actionparam name="guid" value="#{time[ind].guid}" />

      <a4j:actionparam name="row" value="#{row}" />

      <a4j:actionparam name="col" value="#{ind}" />

      </a4j:support>

      </h:inputText>

      </a4j:outputPanel>

      </rich:columns>

       

      </rich:dataTable>

      </ui:fragment>

      </h:form>

      </f:view>

      </rich:tab>

       

       

      </rich:tabPanel>

      </ui:define>

        • 1. Re: Preventing full refresh of data table
          ilya_shaikovsky

          It seems you should revise and clean up the code. Seems some unnesessary "tries" there:

          <ui:define name="content" switchType="ajax">

          switch type has no sence.

           

          <rich:tab rendered="#{buildingResourcesModel.seriesCount>=1}" label="#{buildingResourcesModel.seriesHeadings[0]}" switchType="ajax">

          <a4j:support event="onClick" action="active-tab">

          <a4j:actionparam name="active_tab" value="1" />

          can't get why you need that support at all. and cocurrecy problems will appear there.

           

          And the main

          <a4j:support event="onchange" action="save" reRender="tab1:j_id38:#{row}:C_#{ind}" ajaxSingle="true">

          action="save" - defined means that you want to navigate with save outcome? If you want just reRender - remove it.

          • 2. Re: Preventing full refresh of data table
            nbelaevski

            Some more observations: ui:fragment seems to do nothing & f:view tag is used inside tab.

             

            BTW: http://java.dzone.com/articles/an-introduction-to-jboss-richf?page=1,5

             

            Message was edited by: Nick Belaevski

            • 3. Re: Preventing full refresh of data table

              All of the other code you're seeing is experimental and I've tried everything...everything but removing that action attribute, which I thought I originally had to add or my web flow actions weren't getting invoked at all.  I'll try playing with that and see what happens and I'll post my results.  Thanks.