From xap-commits-return-505-apmail-incubator-xap-commits-archive=incubator.apache.org@incubator.apache.org Tue Sep 26 05:38:20 2006 Return-Path: Delivered-To: apmail-incubator-xap-commits-archive@locus.apache.org Received: (qmail 49946 invoked from network); 26 Sep 2006 05:38:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Sep 2006 05:38:20 -0000 Received: (qmail 4127 invoked by uid 500); 26 Sep 2006 05:38:20 -0000 Delivered-To: apmail-incubator-xap-commits-archive@incubator.apache.org Received: (qmail 4110 invoked by uid 500); 26 Sep 2006 05:38:20 -0000 Mailing-List: contact xap-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: xap-dev@incubator.apache.org Delivered-To: mailing list xap-commits@incubator.apache.org Received: (qmail 4101 invoked by uid 99); 26 Sep 2006 05:38:20 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Sep 2006 22:38:20 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=jmargaris@apache.org; spf=permerror X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received-SPF: error (idunn.apache.osuosl.org: domain apache.org from 140.211.166.113 cause and error) Received: from [140.211.166.113] ([140.211.166.113:49735] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 64/71-05106-BCCB8154 for ; Mon, 25 Sep 2006 22:38:19 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 34DDE1A981A; Mon, 25 Sep 2006 22:38:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r449911 - in /incubator/xap/trunk: WebContent/examples/widgets/table.xal src/xap/bridges/dojo/RowBridge.js src/xap/bridges/dojo/TableBridge.js src/xap/widgets/dojo/TreeTable.js Date: Tue, 26 Sep 2006 05:38:16 -0000 To: xap-commits@incubator.apache.org From: jmargaris@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060926053817.34DDE1A981A@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jmargaris Date: Mon Sep 25 22:38:14 2006 New Revision: 449911 URL: http://svn.apache.org/viewvc?view=rev&rev=449911 Log: expand/collpase event notificatio and attributes, still need to test with sample Modified: incubator/xap/trunk/WebContent/examples/widgets/table.xal incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js Modified: incubator/xap/trunk/WebContent/examples/widgets/table.xal URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/table.xal?view=diff&rev=449911&r1=449910&r2=449911 ============================================================================== --- incubator/xap/trunk/WebContent/examples/widgets/table.xal (original) +++ incubator/xap/trunk/WebContent/examples/widgets/table.xal Mon Sep 25 22:38:14 2006 @@ -25,6 +25,8 @@
Modified: incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js?view=diff&rev=449911&r1=449910&r2=449911 ============================================================================== --- incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js (original) +++ incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js Mon Sep 25 22:38:14 2006 @@ -52,10 +52,18 @@ /** - * No new dynamic attributes + * dynamic attributes */ xap.bridges.dojo.RowBridge.prototype.getNewAllowedAttributes = function(){ - return []; + return ["selected", "expanded"]; +} + +xap.bridges.dojo.RowBridge.prototype.setSelectedAttribute = function( value ){ + this.getPeer().setSelected(value=="true"); +} + +xap.bridges.dojo.RowBridge.prototype.setExpandedAttribute = function( value ){ + this.getPeer().setExpanded(value=="true"); } xap.bridges.dojo.RowBridge.prototype.addChild = function(childHandler, index){ Modified: incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js?view=diff&rev=449911&r1=449910&r2=449911 ============================================================================== --- incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js (original) +++ incubator/xap/trunk/src/xap/bridges/dojo/TableBridge.js Mon Sep 25 22:38:14 2006 @@ -51,7 +51,8 @@ //add listener last so we don't fire for the initial set dojo.event.connect(this.getPeer(), "onActivateRow",this,"onActivateRow"); dojo.event.connect(this.getPeer(), "onSelectRow",this,"onSelectRow"); - dojo.event.connect(this.getPeer(), "onDeselectRow",this,"onDeselectRow"); + dojo.event.connect(this.getPeer(), "onDeselectRow",this,"onDeselectRow"); + dojo.event.connect(this.getPeer(), "onExpandRow",this,"onExpandRow"); } xap.bridges.dojo.TableBridge.prototype.getPeerString = function(){ @@ -63,6 +64,16 @@ clientEvent.rowId = this.getSelectedRowIds(); this.fireEvent("onSelect", null, null, clientEvent); } + +xap.bridges.dojo.TableBridge.prototype.onExpandRow = function( row, expanded ){ + var handler = this.getUiContentHandler().getHandlerForPeer(row); + handler.writeBackAttribute("expanded",""+expanded); + var clientEvent = new xap.session.ClientEvent(this.getElement(), this.getSession()); + clientEvent.rowId = handler.getElement().getAttribute("id"); + this.fireEvent(expanded?"onExpand":"onCollapse", null, null, clientEvent); + +} + xap.bridges.dojo.TableBridge.prototype.onDeselectRow = function( row ){ var handler = this.getUiContentHandler().getHandlerForPeer(row); Modified: incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js?view=diff&rev=449911&r1=449910&r2=449911 ============================================================================== --- incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js (original) +++ incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js Mon Sep 25 22:38:14 2006 @@ -198,7 +198,7 @@ height:"100%", overflow:"auto"}); - dojo.event.connect(this.scrollDiv, "onscroll", this, "onscroll"); + dojo.event.connect(this.scrollDiv, "onscroll", this, "onScrollCallback"); this.table = document.createElement("table"); this.scrollDiv.appendChild(this.table); @@ -348,6 +348,12 @@ _rowAdded: function(row){ row.setTable(this); + //if the row starts as selected when it is added, + //make sure to catch that. + if (row._selected){ + this.selectRow(row); + } + //recurse through all children for (var i = 0; i