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

Key: LPP-1689
Type: Bug Bug
Status: Verified Verified
Resolution: Fixed
Priority: -- --
Assignee: Frisco Del Rosario
Reporter: Pablo Kang
Votes: 0
Watchers: 0
Operations

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

Datacombobox list incorrectly drawn when first opened and list attached on top

Created: 10/Mar/06 03:29 PM   Updated: 26/Jun/06 09:38 PM
Component/s: Components - base
Affects Version/s: None
Fix Version/s: 3.3, 3.3.3

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 42,018
Runtime: N/A
Fix in hand: True


 Description  « Hide
Test case:

<canvas>

    <dataset name="mydset">
        <item value="1">one</item>
        <item value="2">two</item>
        <item value="3">three</item>
        <item value="4">four</item>
    </dataset>

    <view x="200" y="200">
        <datacombobox name="options" statictext="Options" width="100" selectfirst="false"
                      listwidth="154" listattach="top" shownitems="6" ismenu="true"
                      itemdatapath="mydset:/item" />
    </view>

</canvas>

When first opened, datacombobox sets its list's datapath and visibility at the same time. Because the list doesn't originally know its size because each item is still replicating, it places itself incorectly.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Pablo Kang - 10/Mar/06 03:33 PM
The key is to wait an idle moment while the list items are being replicated before showing the list. Here's the fix:

343,346c343,346
< LzFocus.setFocus( this._cblist, false );
<
< this.isopen = true;
< if (this['onisopen']) this.onisopen.sendEvent(true);
---
> if (!this['_showListDel']) {
> this._showListDel = new LzDelegate(this, '_showList');
> }
> LzIdle.callOnIdle(this._showListDel);
363a364,371
> <method name="_showList">
> this._cblist.setVisible(true);
> LzFocus.setFocus( this._cblist, false );
> this.isopen = true;
> if (this['onisopen']) this.onisopen.sendEvent(true);
> </method>
>
> <!--- @keywords private -->

Jim Grandy - 27/Apr/06 02:14 PM
What happens if it takes more than an idle moment for replication to complete? Wouldn't it be better to add event handlers to detect when replication was actually done?

Pablo Kang - 02/May/06 02:44 PM
Yes, you're right. The fix here won't work if it takes longer than an idle moment for replication to complete. Adding event handlers would do the trick.

Jim Grandy - 04/May/06 01:53 AM
It turns out there's a much easier fix: redo the positioning whenever width or height changes.

Jim Grandy - 04/May/06 02:53 PM
Integrated to lps-3.2 as change 42019