History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4468
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: -- --
Assignee: Mamye Kratt
Reporter: Chris Bartak
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

datacombobox getText() missing

Created: 09/Aug/07 01:04 PM   Updated: 27/Sep/07 03:56 PM
Component/s: Components - all
Affects Version/s: 4.0.0
Fix Version/s: None

Time Tracking:
Not Specified

Environment: N/A

Severity: Minor
Fixed in Change#: 6,651
Fixed in branch: trunk
Runtime: N/A
Fix in hand: True


 Description  « Hide
I noticed that datacombobox getText() returns undefined. I added a method to datacombobox.lzx, and it works fine. I'm not set up as a developer, so thought I'd submit the code and maybe someone would get it included, if it's not already been fixed.

<method name="getText">
     return _text.getText();
</method>

thanks.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Max Carlson - 22/Aug/07 10:07 AM
Can you check for a contrib agreement please? Thanks!

Josh Crowley - 31/Aug/07 12:53 AM
Contacted about contributor's agreement 8/31/2007. Will attempt contact again in two weeks if no response is received.

Josh Crowley - 21/Sep/07 03:43 PM
Contributor's agreement in place.

Josh Crowley - 27/Sep/07 03:56 PM
Approved by Ben. Checkin transcript follows:


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 jcrowley@doctormanhattan.mshome.net 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">