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

Key: LPP-5549
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: Elliot Winard
Votes: 0
Watchers: 1
Operations

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

basedatacombobox.onselect event fires even if selectfirst attribute is set to false

Created: 05/Mar/08 11:52 AM   Updated: 02/Jun/08 12:04 PM
Component/s: Components - base
Affects Version/s: Freya
Fix Version/s: Mars, RingDing (4.1)

Time Tracking:
Not Specified

File Attachments: 1. File BUG-datacombobox.lzx (0.4 kb)
2. File newexample.lzx (0.4 kb)


Severity: Minor
Fixed in Change#: 8,312
Runtime: N/A
Fix in hand: False


 Description  « Hide
STEPS:
1. create a class that extends from basedatacombobox
2. set the selectfirst attribute to false
3. create an onselect handler that expects to only be triggered when something is selected

RESULTS:
onselect fires at initialization of combobox

EXPECTED:
onselect does not first until something is actually selected, either programmatically or by user

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Elliot Winard - 05/Mar/08 11:53 AM
attached file. I see this bug in pagan-deities.

Elliot Winard - 05/Mar/08 12:03 PM
compile attached file with debug=true

Amy Muntz - 05/Mar/08 12:26 PM
Max - any chance we can get this into Mars?

P T Withington - 05/Mar/08 01:15 PM
Er, it seems to me that this is an application bug. Handlers will get fired any time the attribute they are listening to are changed, including when they get their initial value. It seems to me the handler needs to filter out based on what the new value is (like a transition from false to true).

Elliot Winard - 05/Mar/08 01:46 PM
but if selectfirst is set to false I wouldn't expect anything to be selected. The existing code we have filters out null selections but it'd be a little prettier if we didn't have to special-case for that.

André Bargull - 07/Mar/08 02:31 PM
"backtrace":
basedatacombobox#init(..)
 -> defaulttext is null
  -> basedatacombobox#_updateSelectionOnData()
   -> basedatacombobox#_updateSelectionByIndex(this._selectedIndex, true)


André Bargull - 07/Mar/08 02:34 PM
> Oops. Itchy trigger finger.
Me too :o)

"backtrace":
basedatacombobox#init(..)
 -> defaulttext is null
  -> basedatacombobox#_updateSelectionOnData()
   -> basedatacombobox#_updateSelectionByIndex(this._selectedIndex, true)

But "_selectedIndex" is -1.

Fix:
either check "_selectedIndex"!=-1 before calling "_updateSelectionByIndex(..)",
or check index in "_updateSelectionByIndex(..)" (Does it make sense to call that function with a negative index?).

Max Carlson - 10/Mar/08 12:06 PM
The change for LPP-4704 appears to fix this issue...

Max Carlson - 12/Mar/08 04:27 PM
Author: max
Date: 2008-03-12 17:18:34 -0700 (Wed, 12 Mar 2008)
New Revision: 8239

Modified:
   openlaszlo/trunk/lps/components/base/basedatacombobox.lzx
Log:
Change 20080312-maxcarlson-D by maxcarlson@Roboto.local on 2008-03-12 14:57:41 PDT
    in /Users/maxcarlson/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix bogus calls to basedatacombobox._updateSelectionByIndex()

New Features:

Bugs Fixed: LPP-5549 - basedatacombobox.onselect event fires even if selectfirst attribute is set to false

Technical Reviewer: promanik
QA Reviewer: enw@laszlosystems.com
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: Make sure the index is valid in _updateSelectionByIndex();
    

Tests: See LPP-5549



Modified: openlaszlo/trunk/lps/components/base/basedatacombobox.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basedatacombobox.lzx 2008-03-12 21:59:56 UTC (rev 8238)
+++ openlaszlo/trunk/lps/components/base/basedatacombobox.lzx 2008-03-13 00:18:34 UTC (rev 8239)
@@ -1,5 +1,5 @@
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2005-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2005-2008 Laszlo Systems, Inc. All Rights Reserved. *
 * Use is subject to license terms. *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <!-- @LZX_VERSION@ -->
@@ -236,6 +236,7 @@
               @keywords private -->
         <method name="_updateSelectionByIndex"
                 args="index,dontSetValue,isinitvalue"> <![CDATA[
+ if (index < 0) return;
             var dp = new LzDatapointer(this);
 
             var nodes = dp.xpathQuery(this.itemdatapath);


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Mamye Kratt - 18/Mar/08 12:56 PM
(pagan-deities branch build r8311 - 4.0.11 RC)

Ran BUG-datacombobox.lzx and it doesn't appear to run correctly.
Spoke with Elliot and EM-5327 is not fixed.
Checked for the code changes in lps/components/base/basedatacombobox.lzx and it isn't there.

Max Carlson - 19/Mar/08 10:33 AM
Resolving...

Mamye Kratt - 27/Mar/08 08:33 AM
(pagan-deities branch build r8434 - mars rc/4.0.11)

Test file runs and lps/components/base/basedatacombobox.lzx contains the fix.

Mamye Kratt - 27/Mar/08 08:34 AM
need to test trunk 4 for ringding.

Mamye Kratt - 02/Jun/08 12:04 PM
(trunk 4 build r9425)

Needed to change the testfile because of changes to the code. Attached new example.