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

Key: LPP-4316
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: -- --
Assignee: Max Carlson
Reporter: André Bargull
Votes: 0
Watchers: 0
Operations

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

"datalistselector#getItemByData(..)" and "datalistselector#getItemIndexByData(..)" should test against null

Created: 18/Jul/07 03:36 PM   Updated: 19/Aug/07 10:26 AM
Component/s: Components - base
Affects Version/s: 4.0.2, 3.3.3
Fix Version/s: 4.0.5WaffleCone

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 6,151
Runtime: N/A
Flags: External
Fix in hand: True


 Description  « Hide
If you don't test against "null", you'll get the first subview resp. 0.

This will return the first subview caused by misbehaviour of "getItemIndexByData(..)":
[code]
<method name="getItemByData" args="data">
<![CDATA[
    return data ? getItemByIndex( this.getItemIndexByData( data ) ) : null;
]]>
</method>
[/code]

This will return 0 for "null"-data, but it should return "null":
[code]
<method name="getItemIndexByData" args="data">
<![CDATA[
    if (data) {
        var svs = immediateparent.subviews;
        if (svs[0].cloneManager) {
            ...
        }
        else if( svs[0].datapath.p == data )//<-- this is the root for this issue, because "svs[0].datapath.p" may be null if there is no data..
            ...
        }
    }
    return null;
]]>
</method>
[/code]

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.