update layoutUnit from an other layoutUnit

UI Components for JSF
Post Reply
zsuiqiang
Posts: 146
Joined: 13 Sep 2010, 03:52

21 Oct 2010, 04:00

Hi,
I use <p:layout> in a page,and i put a tree in "left" layoutUnit and show info of the selected node in center layoutUnit.I want update the center content.but it didn't work.My code:

Code: Select all

<h:body>
        <p:layout fullPage="true">
            <p:layoutUnit position="left" width="200" minWidth="200" maxWidth="300" >
                <h:form>
                     <p:tree value="#{orgBean.root}" var="org"
                           selectionMode="single" selection="#{orgBean.selectedNode}"
                           nodeSelectListener="#{orgBean.onNodeSelect}" update="nodeInfo">
                            <p:treeNode>
                                  <h:outputText value="#{org}"/>
                            </p:treeNode>
                    </p:tree>
                </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="center" gutter="1">
                <h:form>
            		<p:outputPanel>
                		<p:commandButton value="add"/>
                		<p:commandButton value="del"/>
                		<p:commandButton value="edit"/>
            		</p:outputPanel>

            		<h:panelGrid  id="nodeInfo" columns="2">
                		<h:outputText  value="name:"/>
                		<h:inputText value="#{orgBean.org.name}" />
                		<h:outputText value="code:" />
                		<h:inputText value="#{orgBean.org.code}" />
                		<h:outputText  value="manager" />
                		<h:inputText value="#{orgBean.org.manager}" />
                		<h:outputText  value="tel:" />
                		<h:inputText value="#{orgBean.org.tel}" />
            		</h:panelGrid>
        	</h:form>
            </p:layoutUnit>
        </p:layout>
    </h:body>
primefaces:jakarta:12.0.0.jar,
primefaces-ext:jakarta:12.0.0.jar,
JSF Mojarra 3.0
glassfish-6.2.5,
netbeans 14
IDEA 2022.2.2
Browser: Edge

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

21 Oct 2010, 10:45

Try;

Code: Select all

 <h:form prependId="false">
                  <p:outputPanel>
                      <p:commandButton value="add"/>
                      <p:commandButton value="del"/>
                      <p:commandButton value="edit"/>
                  </p:outputPanel>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 55 guests