hmm, not approved.

What is the expected behaviour if a node has got a datapath and a path-constraint and the latter evaluates to null, but the actual datapath is still valid? I think the node should be visible, because a datapath has got a higher priority compared to a path-constraint.

Additionally, in respect of swf9, we should apply stronger typing in the lfc:
// reset visibility a la datapaths for views
if (node is LzView) {
    var view:LzView = node cast LzView;
    view.__LZvizDat = view[attr] != null;
    view.__LZupdateShown();
}

testcase:
<canvas debug="true" layout="axis:y">
    <dataset name="testdata">
        <bar num="123.5"/>
    </dataset>
<dataset name="otherdata">
        <foo />
    </dataset>

<class name="mytext" extends="text" text="${'My data: ' + this.datatext}" >
        <attribute name="datatext" value="" type="string" />
    </class>

    <!-- write in the debugger: -->
    <!-- testdata.getFirstChild().removeAttr("num") -->

    <mytext datatext="$path{'testdata:/bar/@num'}" bgcolor="red" />
    <mytext datatext="$path{'testdata:/bar/@bad'}" bgcolor="red" />
<mytext datapath="otherdata:/foo" datatext="$path{'testdata:/bar/@num'}" bgcolor="silver" /> <mytext datapath="otherdata:/foo" datatext="$path{'testdata:/bar/@bad'}" bgcolor="silver" /> </canvas>



On 7/9/2008 9:13 AM, Max Carlson wrote:
Change 20080709-maxcarlson-d by [EMAIL PROTECTED] on 2008-07-09 00:06:28 PDT
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix visibility of views with $path constraints

Bugs Fixed: LPP-290 - $path attributes can hide the instance/view they belong to

Technical Reviewer: promanik
QA Reviewer: [EMAIL PROTECTED]

Details: Set __LZvizDat and call __LZupdateShown() for views with $path attributes.

Tests: See LPP-290

Files:
M      WEB-INF/lps/lfc/data/LzDataAttrBind.lzs

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080709-maxcarlson-d.tar

Reply via email to