Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 69218 invoked from network); 13 Apr 2010 10:00:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Apr 2010 10:00:13 -0000 Received: (qmail 38631 invoked by uid 500); 13 Apr 2010 10:00:12 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 38571 invoked by uid 500); 13 Apr 2010 10:00:11 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 38545 invoked by uid 99); 13 Apr 2010 10:00:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 10:00:11 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of scott.mcmasters@gmail.com designates 209.85.218.215 as permitted sender) Received: from [209.85.218.215] (HELO mail-bw0-f215.google.com) (209.85.218.215) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 10:00:04 +0000 Received: by bwz7 with SMTP id 7so2303600bwz.36 for ; Tue, 13 Apr 2010 02:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=hGWD/rbXMSw5mAkcxNJkbgc20zUgBxSiHnUKxOFbbZk=; b=J8TEfHRzj2DE57+cowKCX3dU0hpkCO/ObxK9RR5L3PLqY7IPvOak5kFDtpMdvJiUEP A4j2uaHMdmCEzH8UwhnKmi7Kf/yHPFcWlheDHE9Hnp1DN2jmEfFgwmXOTnp+eDIBVMgc v6aTrXxK7aHIjtp1EhxvBemI03NntGuloRxO8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vAOcUsfrqM3eIkxjEosYoI1nzQ7cFJ++xP/IYV8Vbyj8TtvSvj5uzkYjo4B5snKo6U /sSdMZJHd0H3YWOk0iUVvDXW0e99xibHYQkTYsmK5uo+l+OnT6nwwMDPggKFf8tCy6mL DzxW1bZGhkpQVq7dcufNYd+fwGGbijnOtKV9E= MIME-Version: 1.0 Received: by 10.204.33.212 with HTTP; Tue, 13 Apr 2010 02:59:42 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Apr 2010 11:59:42 +0200 Received: by 10.204.18.78 with SMTP id v14mr836718bka.2.1271152782247; Tue, 13 Apr 2010 02:59:42 -0700 (PDT) Message-ID: Subject: Re: [Trinidad] tree nodes not updating in expanded branch From: Scott McMasters To: MyFaces Discussion Content-Type: multipart/alternative; boundary=00032555f9da0a883604841b5237 --00032555f9da0a883604841b5237 Content-Type: text/plain; charset=ISO-8859-1 I'd really appreciate a response. No one responded to my emails last week. Thanks On Mon, Apr 12, 2010 at 7:29 PM, Scott McMasters wrote: > This is an xhtml document which reproduces the problem: > > xmlns:f="http://java.sun.com/jsf/core" > xmlns:t="http://myfaces.apache.org/tomahawk" > xmlns:h="http://java.sun.com/jsf/html" > xmlns:tr="http://myfaces.apache.org/trinidad"> > > > > > > autoSubmit="true" immediate="true" valuePassThru="true" > valueChangeListener="#{treeTest.change}"> > > > > partialTriggers="myList"> > > selected="#{descritorre.selected}" > text="#{descritorre.desMattone}" /> > > > > > > > And this is the Java bean, in session scope: > > package it.eng.sis.mra.test; > > import it.eng.sis.mra.beans.jsf.TpDescritorreNode; > > import java.util.ArrayList; > import java.util.List; > > import javax.faces.context.FacesContext; > import javax.faces.event.ValueChangeEvent; > import javax.faces.model.SelectItem; > > import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel; > import org.apache.myfaces.trinidad.model.TreeModel; > > public class TreeTest > { > private TreeModel model; > private List nodes; > private List selectItems; > private String selectedId; > > public void change(ValueChangeEvent vce) > { > System.out.println("here"); > boolean select = true; > > if(vce.getNewValue().equals("1")) > select = false; > > TpDescritorreNode node = nodes.get(0); > node.setSelected(select); > > for(TpDescritorreNode n: node.getChildNodes()) > n.setSelected(select); > > FacesContext.getCurrentInstance().renderResponse(); > > } > > public TreeTest() > { > nodes = new ArrayList(); > List children = new ArrayList(); > > TpDescritorreNode node = new TpDescritorreNode(); > node.setDesMattone("child 1"); > children.add(node); > > node = new TpDescritorreNode(); > node.setDesMattone("child 2"); > children.add(node); > > node = new TpDescritorreNode(); > node.setDesMattone("child 3"); > children.add(node); > > node = new TpDescritorreNode(); > node.setDesMattone("parent"); > node.setChildNodes(children); > nodes.add(node); > > model = new ChildPropertyTreeModel(nodes, "childNodes"); > > selectItems = new ArrayList(); > selectItems.add(new SelectItem("1", "one")); > selectItems.add(new SelectItem("2", "two")); > > } > > public TreeModel getModel() > { > return model; > } > > public List getSelectItems() > { > return selectItems; > } > > public String getSelectedId() > { > return selectedId; > } > > public void setSelectedId(String selectedId) > { > this.selectedId = selectedId; > > } > > } > > > > On Mon, Apr 12, 2010 at 6:44 PM, Scott McMasters < > scott.mcmasters@gmail.com> wrote: > >> Hello, >> >> I'm using the tree component with ppr, but if a branch is already expanded >> and a trigger is assigned to a select list in the form, the nodes don't >> update. Can someone give me an example how to update the tree nodes >> properly? Each node is a checkbox. >> >> Maybe to explain better, when the user changes the value in the select >> list element, the selected nodes in the tree should change. The values in >> my node objects are being updated, but that's not being reflected in the >> page if the node is visible. If the branch is collapsed, I change the >> select list value and expand the branch, the changes are reflected in the >> page. >> >> Thanks, >> >> Scott McMasters >> >> > --00032555f9da0a883604841b5237--