Change 20080714-laszlo-a by [EMAIL PROTECTED] on 2008-07-14 14:43:01 EDT
   in /home/laszlo/src/svn/openlaszlo/trunk-solidus
   for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Apply a number of contributor bug fixes from Andre Bargull
   and Ludovic Gasc that were approved last fall but that I didn't
   get a chance to check in.

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: andre
QA Reviewer: max
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: From the original changeset:

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)

   UPDATE 2: At Andre's recommendation, I revised getNumItems() in
   datalistselector.lzx to only return 1 if the subview has data, and 0 if
   the subview doesn't.

This change adds public method setContentdatapath() to basegrid (LPP-4317)
   and public attribute showvscroll to grid (LPP-4296).

Tests: Run the following in SWF and DHTML:

<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">
<handler name="onclick">
Debug.write(sgrid.getNumItems());
</handler>
</button>
<button text="setContentdatapath">
<handler name="onclick">
// LPP-4317
Debug.write('bef:', sgrid.contentdatapath);
sgrid.setContentdatapath('multidata:/results/*');
Debug.write('aft:', sgrid.contentdatapath);
</handler>
</button>
<button text="Toggle W2 Vert Scroll">
<handler name="onclick">
vscgrid.setAttribute('showvscroll', !vscgrid.showvscroll);
</handler>
</button>
<button text="Toggle W2 Horiz Scroll">
<handler name="onclick">
vscgrid.setAttribute('showhscroll', !vscgrid.showhscroll);
</handler>
</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.
-After using setContentdatapath, getNumItems should return the appropriate
   count for the new number of items.
   -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/20080714-laszlo-a.tar


Reply via email to