Author: jcrowley
Date: 2007-11-09 16:59:28 -0800 (Fri, 09 Nov 2007)
New Revision: 7206

Modified:
   openlaszlo/trunk/lps/components/base/basegridrow.lzx
Log:
Change 20071107-jcrowley-O by [EMAIL PROTECTED] on 2007-11-07 14:20:42 EST
    in /Users/jcrowley/src/svn/openlaszlo/trunk-g
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Deferring initstage of a Grid results problems

New Features:

Bugs Fixed: LPP-4116 - Deferring initstage of a Grid results
        problems

Technical Reviewer: pbr
QA Reviewer: max
Doc Reviewer: 

Documentation:

Release Notes:

Details: The description provided in the bug was
        no longer reproducible.  I believe someone
        at some point added a check to make sure
        datapath existed before trying to call
        xpathQuery().  However, there was still an
        issue with "p is null" showing up, so I
        added a check to make sure that didn't
        happen.

Tests: Run the following in DHTML and Flash:

<canvas>    
    <dataset name="multidata">
        <results>
            <info first="Bill" last="Henders" phone="1-888-888-8888" hat="no"/>
            <info first="Joan" last="Liszt" phone="1-888-877-8778" hat="no"/>
            <info first="Michael" last="Banyon" phone="1-777-778-7788" 
hat="yes"/>
            <info first="Sylvia" last="Conners" phone="1-877-878-8877" 
hat="no"/>
            <info first="Josef" last="Regnola" phone="1-887-778-8787" hat="no"/>
            <info first="Olivia" last="Estaban" phone="1-778-778-7788" 
hat="yes"/>
        </results>
    </dataset>
    
    <window title="Defer Test" width="400" height="150"
        name="win1">
        <grid id="vscgrid" contentdatapath="multidata:/results/*" 
bgcolor0="0x00FF00" bgcolor1="0xFF0000"
            width="${immediateparent.width}" height="${immediateparent.height}" 
initstage="defer">
            <gridtext editable="false" textalign="center" datapath="@first">
                First Name
            </gridtext>
            <gridtext editable="false" textalign="center" datapath="@last">
                Last Name
            </gridtext>
            <gridtext editable="false" textalign="center" datapath="@phone">
                Phone Number
            </gridtext>
            <gridtext editable="false" textalign="center" datapath="@hat">
                Wears Hat
            </gridtext>
        </grid>
    </window>

    <window title="poke" layout="axis:'y'" x="${win1.width+10}">
        <button text="Complete Instantiation">
            <method event="onclick">
                vscgrid.completeInstantiation();
            </method>
        </button>
    </window>

</canvas>

Click the button.  Note that there is no "p is null" error, nor is there
        (as described in the bug) an error about xpathQuery(), and that
        the alternating colors work as before.



Modified: openlaszlo/trunk/lps/components/base/basegridrow.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basegridrow.lzx        2007-11-10 
00:53:22 UTC (rev 7205)
+++ openlaszlo/trunk/lps/components/base/basegridrow.lzx        2007-11-10 
00:59:28 UTC (rev 7206)
@@ -41,8 +41,9 @@
         </method>
 
         <method name="setRegularColor" >
+            <![CDATA[
             var pos = 0;
-            if (this.datapath != null) {
+            if (this.datapath != null && this.datapath.isValid()) {
                 pos = this.datapath.xpathQuery( 'position()' );
             }
             var nextColor = null;
@@ -53,6 +54,7 @@
                 this.regularColor = nextColor;
                 this.updateBGColor();
             }
+            ]]>
         </method>
 
         <handler name="ondata">


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to