0 Replies Latest reply on Jul 28, 2011 1:09 PM by Chris Hornsey

    Rerendering within a h:datatable

    Chris Hornsey Newbie

      I am trying to determine how reredering works within a datatable functions.

       

      I have determine that the follwoing works according to my expectations:  When the user changes the option, the specified datatable is rerendered.

      <h:selectOneMenu value="#{bean.choice}">
                                    <f:selectItem itemValue="a" value="A"/>
                                    <f:selectItem itemValue="b" value="B"/>

        <a4j:support event="onchange" ajaxSingle="true" reRender="table1"/>

      </h:selectOneMenu>

      <h:dataTable id="table1" var="row" value="#{bean.list}">

            ......

       

      I was expecting that I could use a very similar use case to rerender components within the datatable.  I understand the actual component names will be rendered with id's determined by its position within the datatable, this implementation does not work to my expectations, the values in the table are not rerendered when the menu is modified.

      <h:selectOneMenu value="#{bean.choice}">
                                    <f:selectItem itemValue="a" value="A"/>
                                    <f:selectItem itemValue="b" value="B"/>

        <a4j:support event="onchange" ajaxSingle="true" reRender="outstandingCol"/>

      </h:selectOneMenu>

      <h:dataTable id="table1" var="row" value="#{bean.list}" cols="2">

           <h:ouputText id="column1' value="#{row.col1}"/>

           <h:ouputText id="outstandingCol' value="#{bean.outstandingValue}"/>

      </h:dataTable>

       

      I was suspect that using the rerender attribute may not work given the duplication of components within the datatabe.

      I also tried surronding the second outputtext in the table with an <a4j:outputPanel ajaxRendered="true"> and excluding the reRender attribute from the a4j:support tag.  This also did not produce the desired result.

       

      In short is it possible to rerender components within a datatable rather than the entire datatable?  I have read the richfaces basic concepts document and was unable to find anything that addresses this specifically so i am starting to beleive it is not possible.