treeDont update =(

UI Components for JSF
Post Reply
Forn
Posts: 10
Joined: 12 Apr 2012, 10:59

12 Apr 2012, 13:34

Hello, I have html:

Code: Select all

....
<p:layoutUnit position="north" resizable="false" closable="false" collapsible="false">
				<h:form id='formMenu'>
					<p:growl id="messages" showDetail="true" sticky="true" autoUpdate="true" />
					<p:menubar model="#{uiManager.menuModel}" /> 
				</h:form>
			</p:layoutUnit>

		<p:layoutUnit position="west"  size="200" header="menu"
				resizable="true" closable="false" collapsible="true">
				<h:form id='formTree'>  
					<p:tree id="mainTree" value="#{uiManager.mainTree}" var="treeItem" dynamic="true" cache="true" size="150">  
						<p:treeNode expandedIcon="ui-icon-folder-open"  
	                    	collapsedIcon="ui-icon-folder-collapsed">  
	            			<h:outputText value="#{treeItem}"/>  
	        			</p:treeNode>
	        		</p:tree>
        		</h:form>  
			</p:layoutUnit>
.....

Code: Select all

if (AsgeUtils.isNotNull(item.getAction())) {
        Class<?>[] param = { String.class };
        MethodExpression action = app.getExpressionFactory().createMethodExpression(ctx.getELContext(), item.getAction(), Void.class, param);
        menuItem.setActionExpression(action);
      }
Action is: #{uiManager.initMainTree('3::AsgePortalFolder')}

Code: Select all

/**
   * init tree.
   * 
   * @param rootFolderId
   *          rootFolderId
   */
  public void initMainTree(String rootFolderId) {
    FacesContext.getCurrentInstance().addMessage(null,
        new FacesMessage(FacesMessage.SEVERITY_INFO, "initMainTree invoked: rootFolderId", ""));

    mainTree = new DefaultTreeNode("root", null);

    TreeNode node0 = new DefaultTreeNode(rootFolderId, mainTree);
  }
Update Code is: :formTree:mainTree

So after i click menu item methdo invoke and new mainTree is inited, but in the view the tree dont update, it update only after I press F5
GlassFish: 3.1.2 PrimeFaces: 3.3-SNAPSHOT JSF: Mojarra 2.1.6 Java: 1.7u3 OS: AltLinux 6.x

Forn
Posts: 10
Joined: 12 Apr 2012, 10:59

13 Apr 2012, 07:37

So. dont any body know?
GlassFish: 3.1.2 PrimeFaces: 3.3-SNAPSHOT JSF: Mojarra 2.1.6 Java: 1.7u3 OS: AltLinux 6.x

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

13 Apr 2012, 08:12

viewtopic.php?f=3&t=1194

See point three. And while you at it, read the others as well...

Cheers,

Ronald

Forn
Posts: 10
Joined: 12 Apr 2012, 10:59

13 Apr 2012, 20:20

I write simply test:

Code: Select all

<ui:define name="global">
		<p:layout fullPage="true">
			<p:layoutUnit position="north" resizable="false" closable="false" collapsible="false" id="layoutMenu">
				<h:form id='formMenu'>
					<p:menubar model="#{uiManager.menuModel}" id="mainMenu"/> 
				</h:form>
			</p:layoutUnit>

			<p:layoutUnit position="south" size="100" header="Bottom"
				resizable="true" closable="true" collapsible="true">
				<h:outputText value="South unit content." />
				<p:commandButton
 value="Enter"
 image="ui-icon ui-icon-comment"
 update="formTree formTree:mainTree"
     actionListener="#{uiManager.initMainTree('3::AsgePortalFolder')}" />
				
			</p:layoutUnit>

			<p:layoutUnit position="west"  size="300" header="navigation"
				resizable="true" closable="false" collapsible="true" id="layoutNavigation">
				<h:form id='formTree'>
					<p:panel id="panelMainTree">
						<p:tree id="mainTree" value="#{uiManager.mainTree}" var="treeItem"
							style="width:200px;">
							<p:treeNode expandedIcon="ui-icon-folder-open"
								collapsedIcon="ui-icon-folder-collapsed">
								<h:outputText value="#{treeItem}" />
							</p:treeNode>
						</p:tree>
					</p:panel>
				</h:form>  
			</p:layoutUnit>

			<p:layoutUnit position="center" id="layoutData">
				<h:form>  
            		This fullPage layout consists of five different layoutUnits which are resizable and closable by default.  
		        </h:form>
			</p:layoutUnit>
		</p:layout>
But when i click button there is no result? The tree dont update? Why?
GlassFish: 3.1.2 PrimeFaces: 3.3-SNAPSHOT JSF: Mojarra 2.1.6 Java: 1.7u3 OS: AltLinux 6.x

Forn
Posts: 10
Joined: 12 Apr 2012, 10:59

18 Apr 2012, 08:02

The partial update is empty when i click the menu element.
So does this is bug of primefaces?

POST responce:

Code: Select all

<?xml version='1.0' encoding='ISO-8859-1'?>
<partial-response><changes><update id="javax.faces.ViewState"><![CDATA[e2s1]]></update></changes></partial-response>
POST Content:

Code: Select all

formMenu	formMenu
formMenu:j_id17	formMenu:j_id17
javax.faces.ViewState	e2s1
javax.faces.partial.ajax	true
javax.faces.partial.execu...	@all
javax.faces.partial.rende...	formTree
javax.faces.source	formMenu:j_id17
After this GET:

Code: Select all

<?xml version='1.0' encoding='ISO-8859-1'?>
<partial-response><changes><update id="javax.faces.ViewState"><![CDATA[e2s1]]></update></changes></partial-response>
GlassFish: 3.1.2 PrimeFaces: 3.3-SNAPSHOT JSF: Mojarra 2.1.6 Java: 1.7u3 OS: AltLinux 6.x

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests