Author: jcrowley
Date: 2007-09-27 15:52:59 -0700 (Thu, 27 Sep 2007)
New Revision: 6651

Modified:
   openlaszlo/trunk/lps/components/base/basedatacombobox.lzx
   openlaszlo/trunk/lps/components/lz/datacombobox.lzx
Log:
Change 20070926-jcrowley-K by [EMAIL PROTECTED] on 2007-09-26 04:47:38 EDT
    in /Users/jcrowley/src/svn/openlaszlo/trunk-a
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Local datasets do not work in datacomboboxes;
        datacombobox getText() missing

New Features:

Bugs Fixed: LPP-3811 - Local datasets do not work in datacomboboxes
        LPP-4468 - datacombobox getText() missing

Technical Reviewer: pbr
QA Reviewer: ben
Doc Reviewer: 

Documentation:

Release Notes:

Details: Andre Bargull - LPP-3811.  Implemented his change
        to basedatacombobox.  (This was still pending review;
        ignore pending changeset 20070814-jcrowley-n.)

        Chris Bartak - LPP-4468.  Implemented his change
        to add getText() to datacombobox.

Tests: For LPP-3811:

[Removed this code due to a complaint from SVN about line
ending styles being inconsistent.]



Modified: openlaszlo/trunk/lps/components/base/basedatacombobox.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basedatacombobox.lzx   2007-09-27 
22:34:07 UTC (rev 6650)
+++ openlaszlo/trunk/lps/components/base/basedatacombobox.lzx   2007-09-27 
22:52:59 UTC (rev 6651)
@@ -197,7 +197,7 @@
 
             var t = dp.xpathQuery(this.textdatapath);
             // if t is null, use default text (if it exists)
-            if( ( t == null || t.length == 0 ) && this.defaulttext && 
this.defaulttext['length'] > 0 )
+            if( ( t == null || t.length == 0 ) && this.defaulttext['length'] > 
0 )
                t = this.defaulttext;
 
             if ( this._cbtext && (this.statictext == null) ) {
@@ -215,7 +215,7 @@
             if (this.ismenu) {
                 // Clear the selection
                 this._selectedIndex = -1;
-                if (this._cblist && this._cblist['_selector']) {
+                if (this._cblist['_selector']) {
                     this._cblist._selector.clearSelection();
                 }
             }
@@ -230,13 +230,12 @@
 
         <!--- @keywords private -->
         <method name="_setupcblist" args="force"> <![CDATA[
+            if (this._cblist == null) {
 
-            if (this._cblist == null) {
-            
                 if (this.itemclassname == "") {
                     this.itemclassname = "basedatacombobox_item";
                 }
-    
+
                 var icn = this.itemclassname;
 
                 var flcn = this.menuclassname;
@@ -244,19 +243,19 @@
                     if (typeof global[flcn] == "undefined")
                         Debug.format("basedatacombobox floatinglist class (%w) 
is undefined", flcn);
                 }
-                
+
                 var cblist = new global[flcn](this,
-                                              { visible:false, 
-                                                attach: this.listattach, 
-                                                attachoffset: -2, 
+                                              { visible:false,
+                                                attach: this.listattach,
+                                                attachoffset: -2,
                                                 itemclassname: icn
                                               });
-                
+
                 // add in a white view to reduce the visual effect of the
                 // list items appearing as they are created
                 var tmp = new global[icn](cblist, { name:'item' });
                 new LzDatapath(tmp, { pooling: true });
-                
+
                 this._cblist = cblist;
 
                 // Make sure we deselect if we're acting like a menu
@@ -268,15 +267,24 @@
                 cblist.setWidth(w);
                 cblist.setAttachTarget(this);
                 cblist.setAttribute('shownitems', this.shownitems);
-                cblist.item.setDatapath(this.itemdatapath);
 
+                //local-dataset-modification by senshi
+                var itd = this.itemdatapath;
+                if (itd.indexOf( "local:" ) == 0) {
+                  itd = "local:" + "parent.owner." + itd.substring( 6 );
+                  if ($debug)
+                    Debug.write( "local-dataset-modification:" + itd );
+                }
+
+                cblist.item.setDatapath(itd);
+
                 cblist.setAttribute('attach', this.listattach);
                 if (this._selectdel == null) {
                     this._selectdel = new LzDelegate( this, "_flistselect" );
                 }
                 this._selectdel.register(cblist, 'onselect');
             }
-            
+
             if (! this.ismenu) {
                 // Set the item for _cblist
                 var item = _getItemAt(this._selectedIndex);

Modified: openlaszlo/trunk/lps/components/lz/datacombobox.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/datacombobox.lzx 2007-09-27 22:34:07 UTC 
(rev 6650)
+++ openlaszlo/trunk/lps/components/lz/datacombobox.lzx 2007-09-27 22:52:59 UTC 
(rev 6651)
@@ -32,6 +32,10 @@
         <!--- Tell base class about our label view.
               @keywords private -->
         <attribute name="_cbtext" value="$once{this._text}" />
+        
+        <method name="getText">
+             return _text.getText();
+        </method>
 
         <!--- @access private -->
         <method name="_showEnabled">


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to