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

Key: LPP-4630
Type: Bug Bug
Status: Verified Verified
Resolution: Fixed
Priority: P1 P1
Assignee: Henry Minsky
Reporter: Pablo Kang
Votes: 0
Watchers: 0
Operations

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

Dataset subclasses doRequest oninit if autorequest="true" and request="false"

Created: 01/Sep/07 05:33 PM   Updated: 24/Oct/07 10:26 AM
Component/s: LFC - Data
Affects Version/s: 4.0.3
Fix Version/s: 4.0.5WaffleCone

Time Tracking:
Not Specified

File Attachments: 1. File 4630-bad.lzx (0.5 kb)
2. File 4630-good.lzx (0.3 kb)
3. File 4630-workaround.lzx (0.8 kb)


Severity: Minor
Fixed in Change#: 6,326
Runtime: N/A
Fix in hand: False


 Description  « Hide
Setting autorequest="true" shouldn't invoke doRequest oninit. That's what the request attribute is supposed to do.

<canvas debug="true">

    <!-- suppress spurious compilation warning -->
    <attribute name="validate" value="false"/>

    <!-- This should not invoke doRequest oninit, but it does. -->
    <class name="mydataset" extends="dataset" request="false" autorequest="true">
        <method name="doRequest" args="anArg">
            Debug.write("should not have been invoked. request is " + this.request);
        </method>
    </class>

    <mydataset name="mydset"/>
</canvas>

Compare to the way it should work:

<canvas debug="true">
    <dataset name="dset" request="false" autorequest="true">
        <method name="doRequest" args="anArg">
            Debug.write("this does not get called");
        </method>
    </dataset>
</canvas>

Workaround for now:

<canvas debug="true">

    <!-- suppress spurious compilation warning -->
    <attribute name="validate" value="false"/>

    <class name="mydataset" extends="dataset" request="false" autorequest="true">
        <method name="doRequest" args="anArg">
            Debug.write("this will only get called when request is true");
        </method>
        <method name="init">
            super.init();
            if (this.request) this.doRequest();
        </method>
        <!--- work to override setRequest in super class from creating
              delegate. -->
        <method name="setRequest" args="request">
            this.request = request;
        </method>
    </class>

    <mydataset name="mydset"/>
</canvas>


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Henry Minsky - 01/Sep/07 05:55 PM
I thought it was a little odd that the two attributes were linked this way, but that is what was already implemented, so
I didn't want to change the old behavior. It's hard to imagine anyone is depending on this behavior though, and they really ought to be independent, so I'll modify it.

Henry Minsky - 11/Sep/07 06:09 AM
------------------------------------------------------------------------
r6326 | hqm | 2007-09-01 21:59:49 -0400 (Sat, 01 Sep 2007) | 28 lines
Changed paths:
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataset.lzs

Summary: unlink request attribute and autorequest attribute on dataset

New Features:

Bugs Fixed: LPP-4630
Bugs: LPP-4630

Technical Reviewer: pkang (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

There doesn't seem to be any good reason for setAutorequest to call
setRequest. The user
can set them indepenndently in any combination they want using the two setters.


Tests:

test/lfc/data/alldata.lzx


Steve O'Sullivan - 24/Oct/07 10:26 AM
I ran the three attached tests in r6938 on IE7 and Safari 2.0.4 and got no errors reported in any script. Verifed.