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

Key: LPP-4612
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P1 P1
Assignee: Max Carlson
Reporter: Pablo Kang
Votes: 0
Watchers: 0
Operations

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

Explicit replicator doesn't update when items are added or deleted

Created: 29/Aug/07 05:19 PM   Updated: 23/Oct/07 02:42 PM
Component/s: Components - all
Affects Version/s: 4.0.3
Fix Version/s: 4.0.5WaffleCone

Time Tracking:
Not Specified

Severity: Major
Fixed in Change#: 6,344
Runtime: N/A
Fix in hand: False


 Description  « Hide
Test case:

<canvas debug="true">

    <dataset name="ds">
        <item name="one"/>
        <item name="two"/>
        <item name="three"/>
        <item name="four"/>
    </dataset>

    <simplelayout/>

    <button text="add new item">
        <handler name="onclick">
            ds.appendChild(new LzDataElement("item", { name: "NEW ITEM"}));
            Debug.write('ds childNodes:', ds.childNodes);
        </handler>
    </button>

    <view id="list" layout="axis: y">
        <replicator name="rep" dataset="ds" xpath="'/item'">
            <view>
                <text datapath="@name"/>
                <handler name="onclick">
                    this.data.parentNode.removeChild(this.data);
                    Debug.write('ds childNodes:', ds.childNodes);
                </handler>
            </view>
        </replicator>
    </view>
</canvas>


Also, shouldn't you be able to set datapath="dset:/somexpath"?

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Max Carlson - 23/Oct/07 12:37 PM
To test, you should be able to click the 'add new item' button and see items added to the list. Clicking on an item in the list will delete it. This should work for any number of items - make sure this works with a single item in the list also.

Max Carlson - 23/Oct/07 02:42 PM
I'm guessing there's a bug in the testcase. I've been testing with test/explicit-replicators/replicator.lzx. It mostly works but it fails for only a single item under wafflecone only. I'll propose a change that fixes this shortly...