[Laszlo-user] Strange LazyReplication behaviour with checkboxes - and some other questions

Tim Dauer tim.dauer at evision.de
Tue Jun 23 08:57:30 PDT 2009


Hi List!

I experienced a strange behaviour when I tried to use some fancy 
LazyResizeReplication to boost my applications performance compiled with 
OL 4.3. I want to display a large set of Inboxentries (could be more 
than 200 or 300 entries) - each of these replicated Objects is a view 
that contains several Icons, Buttons, Text-Elements and, last but not 
least, a checkbox to mark this item.

First of all: When I mark one item and scroll down, suddenly other items 
are selected as well... at least their checkbox is appareantly (Have a 
look at the code-example below). Is this a glitch or am I missing 
somethin important?

Second thing: When I scroll down, the data of the Items is not changed 
correctly (not in the attached example, but in my "big" application 
which is a little bit more complicated). Is this a common issue and how 
do I avoid that? It seems, that the same kind of Objects is rolled over 
an over again - but surprisingly the marked checkbox appears at 
different items. Very strange and seriously anoying...

Third question: I am replicating the Objects in my inbox using a 
dataset, which is filled during the startup of the application (servlet 
call). But in my Objects I have to display some more Information which 
is not located in my "inbox-dataset" but in my addressbook - such as 
name of the sender of the message. In the developer guide you can read 
somethin like "All displayed data has to be provided through the 
underlying dataset - if you change information you should store the 
changes in the Dataset". But what does happen if some of the displayed 
data is not locatet in the dataset which triggers the replication?! 
Please don't tell me to add datanodes to the replication-dataset, that 
are copies of the other dataset to display their information :)

So, any thoughts? See the attached File for further information!

Greets
Tim

####################################################################
<canvas width="800" height="200" debug="false">
    <dataset name="dsInbox">
        <inbox>
            <item>
                <id>1</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>2</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>3</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>4</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>5</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>6</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>7</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>8</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>9</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>10</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>11</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>12</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>13</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>14</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>15</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>16</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>17</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
            <item>
                <id>18</id>
                <type>1</type>
                <info></info>
                <to></to>
                <size>50 Bytes</size>
                <new>false</new>
            </item>
        </inbox>
    </dataset>
    <view name="clippingView" width="100%" height="100%" clip="true">
        <view id="replicationContainer" width="100%">
            <simplelayout axis="y"/>
            <InboxItem width="100%" height="40">
                <datapath name="dp" rerunxpath="true" 
replication="resize" xpath="dsInbox:/inbox/item">
                   
                </datapath>
            </InboxItem>
        </view>
        <scrollbar name="theScrollbar"/>
    </view>
   
    <class name="InboxItem" width="100%" extends="view">
        <attribute name="raised" value="false" type="boolean"/>
       
        <!-- ### GUI ### -->
        <view name="mainframe" width="100%" >
            <simplelayout axis="x" spacing="5"/>
           
            <view name="chk_view" width="2%" height="100%">
                <checkbox x="5" name="chk_mark" valign="middle">
                   
                </checkbox>
            </view>
               
            <view name="idview"  valign="middle">
                <text name="t_id" align="center" valign="middle" 
datapath="id/text()">
                   
                </text>
            </view>
            <view  name="typeview"  valign="middle">
                <text name="t_type" align="center" valign="middle" 
datapath="type/text()">

                </text>
            </view>
            <view  name="sizeview"  valign="middle">
                <text name="t_size" align="center" valign="middle" 
datapath="size/text()">

                </text>
            </view>           
        </view>
    </class>
</canvas>


More information about the Laszlo-user mailing list