[Laszlo-dev] [BULK] Re: [BULK] UPDATE: For Review: Change, 20071011-jcrowley-2 Summary: Various contributor bug fixes, from Andre, Bargull (3) and Ludovic Gasc (1)

J Crowley jcrowley at laszlosystems.com
Fri Oct 12 12:43:37 PDT 2007


Changing it to classroot.showvscroll results in:

WARNING @lz/grid.lzx#53: reference to undefined property '_scrx'
ERROR @lz/grid.lzx#53: undefined object does not have a property 'width'
WARNING @lz/grid.lzx#53: reference to undefined property 'width'

which is why I'm checking that classroot._scrx isn't undefined before  
trying to reference it.

On Oct 12, 2007, at 3:39 PM, André Bargull wrote:

> Not approved!
>
> LPP-4296:
> Please change
>  typeof classroot._scrx != 'undefined'
> to
>  classroot.showvscroll
> That's easier to read and much less confusing.
>
>
> LPP-4318:
> - Changing "datalistselector.lzx" is good, but does anyone rely on  
> this functionality of returning 0 in "datalistselector#getNumItems()"?
> - You need to update the doc for "datalistselector#getNumItems()"!
> - This change will introduce a new bug: basegrid#getNumItems() will  
> print 1, when it should be 0 (see below for a test-app).
>  So, before this change basegrid#getNumItems() returned 0 for no  
> data and a single line of data,
>  now it will print 1 for no data and a single line of data...
>
> test-application:
> <canvas debug="true" >
>  <dataset name="ds" >
>    <root />
>  </dataset>
>  <grid id="foo" contentdatapath="ds:/root/node" >
>    <gridcolumn text="ID" >
>      <text datapath="@id" />
>    </gridcolumn>
>  </grid>
> </canvas>
>
>> Change 20071011-jcrowley-2 by jcrowley at doctormanhattan.mshome.net  
>> on  2007-10-11 00:30:04 EDT
>>      in /Users/jcrowley/src/svn/openlaszlo/trunk-c
>>      for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: Various contributor bug fixes, from Andre Bargull (3)  
>> and  Ludovic Gasc (1)
>>
>> New Features:
>>
>> Bugs Fixed: LPP-4319 - "basegrid#makeCellsAndColumns()" may  
>> ignore  "shownitems"
>> 	LPP-4318 - "basegrid#getNumItems()" returns wrong value
>> 	LPP-4317 - no setter for "contentdatapath" in basegrid
>> 	LPP-4296 - [patch] add showvscroll attribute for the grid class
>>
>> Technical Reviewer: pbr
>> QA Reviewer: ben
>> Doc Reviewer:
>>
>> Documentation:
>>
>> Release Notes:
>>
>> Details: Applied fixes provided by Andre Bargull (LPP-4319,  
>> LPP-4318,  LPP-4317) and
>> 	Ludovic Gasc (LPP-4296).
>>
>> 	UPDATE: At Phil's recommendation, I fixed getNumItems() in   
>> datalistselector.lzx
>> 	instead of in basegrid.lzx.  (See: LPP-4318)
>>
>> 	This change adds public method setContentdatapath() to basegrid   
>> (LPP-4317)
>> 	and public attribute showvscroll to grid (LPP-4296).
>>
>> Tests: <canvas>
>>      <dataset name="singledata">
>>          <results>
>>              <info first="Bill" last="Henders"  
>> phone="1-888-888-8888"/>
>>          </results>
>>      </dataset>
>>
>>      <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="Single Row / Set Content Datapath"  
>> width="400"  height="150" name="win1">
>>          <grid id="sgrid" contentdatapath="singledata:/results/info 
>> [1]"
>>              width="${parent.width}" height="${parent.height}">
>>              <gridtext editable="false" textalign="center"   
>> datapath="@first">
>>                  First
>>              </gridtext>
>>              <gridtext editable="false" textalign="center"   
>> datapath="@last">
>>                  Last
>>              </gridtext>
>>          </grid>
>>      </window>
>>      <window title="Vertical Scroll Test" width="400"  
>> height="150"  y="150"
>>          name="win2">
>>          <grid id="vscgrid" contentdatapath="multidata:/results/ 
>> *"  showvscroll="false"
>>              width="${immediateparent.width}" height="$  
>> {immediateparent.height}">
>>              <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="getNumItems">
>>              <method event="onclick">
>>                  Debug.write(sgrid.getNumItems());
>>              </method>
>>          </button>
>>          <button text="setContentdatapath">
>>              <method event="onclick">
>>                  // LPP-4317
>>                  Debug.write('bef:', sgrid.contentdatapath);
>>                  sgrid.setContentdatapath('multidata:/results/*');
>>                  Debug.write('aft:', sgrid.contentdatapath);
>>              </method>
>>          </button>
>>          <button text="Toggle W2 Vert Scroll">
>>              <method event="onclick">
>>                  vscgrid.setAttribute('showvscroll', !  
>> vscgrid.showvscroll);
>>              </method>
>>          </button>
>>          <button text="Toggle W2 Horiz Scroll">
>>              <method event="onclick">
>>                  vscgrid.setAttribute('showhscroll', !  
>> vscgrid.showhscroll);
>>              </method>
>>          </button>
>>      </window>
>>
>> </canvas>
>>
>> getNumItems should now return 1 instead of 0 on a single row of data.
>> setContentdatapath should set the datapath from the first dataset to
>> 	the second one.
>> You should be able to toggle scrollbars in the vertical direction,  
>> now,
>> 	as well, instead of just horizontal.
>>
>> Files:
>> M      lps/components/lz/grid.lzx
>> M      lps/components/base/datalistselector.lzx
>> M      lps/components/base/basegrid.lzx
>>
>> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071011-  
>> jcrowley-2.tar
>




More information about the Laszlo-dev mailing list