Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javax.faces.ViewState is missing after ajax render

This is not a duplicate post, i just done research but not helping.

First, this is my page... simplified for easy reading.

            <h:form id="treeForm">
                <f:event type="preRenderView" listener="#{taskTreeBean.update}" />              
                <rich:tree id="tree" nodeType="#{node.type}" var="node"
                    value="#{taskTreeBean.rootNodes}" toggleType="client"
                    selectionType="ajax"
                    render="@all"
                    selectionChangeListener="#{taskTreeBean.selectionChanged}">
                    <rich:treeNode>
                    ...
                    </rich:treeNode>
                </rich:tree>
            </h:form>
            <h:form id="taskListTableForm">
                <rich:dataTable id="taskListTable" styleClass="tasklist" keepSaved="true" value="#{taskListModel}" var="task"
                    rowClasses="odd-row, even-row" rows="3">
                    <rich:column>
                    ...
                    </rich:column>
                    <f:facet name="footer">
                        <rich:dataScroller id="scroller" for="taskListTable" />
                    </f:facet>
                </rich:dataTable>
            </h:form>

When i click some tree node, task list form will render, but the viewstate will disappear, which makes dataScroller requires two clicks to next/prev page since the first click is getting back the ViewState value.

I checked the JIRA here - http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790.

Tried render="@all" or render="treeForm, taskListTableForm", both failed. I cannot wait mojarra to release 2.2. So is there any workaround here?

Thanks so much. The JIRA is just too difficult to understand.

Edited: There is another problem, the page go from 1 to 2 in the dataTable if i click the tree node. Why?

like image 764
Tommy Avatar asked Oct 20 '11 03:10

Tommy


1 Answers

I am aware that you probably solved this problem, but for future reference, this should provide others with the solution.

like image 133
Misa Avatar answered Nov 15 '22 11:11

Misa