0

I have searched through forums and am aware of how id-generation of HTML-DOM-Elements work with NamingContainers and without them. Nonetheless, in this code i try to put a commandbutton in one side of the page, that should trigger an update of the other side of the page.

The 'viewWorkbenchButton' fires its action properly and the backend-data is fine. But :wbManageForm:wbMgmtPanel is not updated.

<ui:composition xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">

<f:view>
    <p:panel id="dataGridPanel">
        <p:panelGrid id="dataGridPanelGrid" styleClass="pGrid" columns="2"
            columnClasses="alignTop, alignTop">
            <p:column>
                <h:form id="wbSelectForm">
                    <p:panel styleClass="noBorderPanel">
                        <p:dataTable var="workbench"
                            value="#{WorkbenchControllerBean.myWorkbenches}"
                            paginator="#{WorkbenchControllerBean.myWorkbenches.size() > 10}"
                            rows="10"
                            paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}">
                            <f:facet name="header">  
                                    My Workbenches  
                                </f:facet>

                            <p:column headerText="Id" sortBy="#{workbench.workbenchId}">
                                <h:outputText value="#{workbench.workbenchId}" />
                            </p:column>

                            <p:column headerText="Name" sortBy="#{workbench.name}">
                                <h:outputText value="#{workbench.name}" />
                            </p:column>

                            <p:column headerText="Actions">
                                <p:commandButton id="viewWorkbenchButton" icon="ui-icon-show"
                                    title="View Workbench" update=":wbManageForm:wbMgmtPanel"
                                    actionListener="#{WorkbenchControllerBean.viewWorkbench(workbench)}">
                                </p:commandButton>

                            </p:column>
                        </p:dataTable>
                    </p:panel>
                </h:form>
            </p:column>

            <p:column>
                <h:form id="wbManageForm">
                    <p:panel id="wbMgmtPanel" styleClass="noBorderPanel">
                        <h:outputText id="tabText" value="Active Wb: #{WorkbenchControllerBean.number}" />
                        <p:tabView id="tabView">
                        ....
                        </p:tabView>

                    </p:panel>
                </h:form>
            </p:column>
        </p:panelGrid>
    </p:panel>
</f:view>

I already tried to update different components (:wbManageForm, :wbManageForm:tabText, :wbManageForm:tabView:treetable) but none of them was updated...

I am using Primefaces 3.5.

What am i missing here? Thanks a lot in advance!

VulfCompressor
  • 1,390
  • 1
  • 11
  • 26
user3178676
  • 31
  • 2
  • 3
  • What's the purpose of having two forms ? You could have just one, and update it with `@form`. Is your `ui:composition` inside a form too ? –  Jan 09 '14 at 17:57
  • Have you tried to update `@all`? Also, take a look in this answer of BalusC: http://stackoverflow.com/questions/4474789/jsfprimefaces-ajax-update-of-several-elements-by-ids – Pellizon Jan 09 '14 at 18:43
  • I tried everything but it still does not work. I minimized my code to better show the problem and asked again here: http://stackoverflow.com/questions/21044983/primefaces-commandbutton-update-does-not-work – user3178676 Jan 10 '14 at 12:59

1 Answers1

-1

Try using action instead of actionListener. Also, update only the wbmanageForm. If that doesn't work, try updating the component with your bean method.

You can do that by adding this to the end of your method: RequestContext.getCurrentInstance().update("wbManageForm");

VulfCompressor
  • 1,390
  • 1
  • 11
  • 26
  • I tried everything but it still does not work. I minimized my code to better show the problem and asked again here: http://stackoverflow.com/questions/21044983/primefaces-commandbutton-update-does-not-work – user3178676 Jan 10 '14 at 12:59