I think using childNodes is essentially equivalent, and it's well
defined, so that would be a better thing to do. The 'data' field is
used internally, but it wasn't ever really defined
for public use. It should probably have a name like __data or
something to keep people
from using it.


We do use "data" as a field on LzDataText to get the text content, but
that is not a W3C  DOM API standard
I think.



On 9/5/07, Elliot Winard <[EMAIL PROTECTED]> wrote:
> If I have a bunch of instances of data-bound views (or class instances)
> that access the object's .data property.  This is not a documented field
> in LzView or LzNode but I started using it when I caught [ondata]
> events.  See example below.
>
> My question is.... is it safe to refer to the data property of a
> data-bound view?  If so, I'll log a LPP bug that it should be documented.
>
> Thanks!
> -e
>
> <canvas height="500" debug="true">
>     <dataset name="ds">
>         <item name="Harry" />
>         <item name="Ron" />
>         <item name="Hermione" />
>     </dataset>
>
>     <button text="set data one"
> onclick="myview.setDatapath('ds:/item[1]')" />
>     <button text="set data many" onclick="myview.setDatapath('ds:/item')" />
>
>     <view name="myview">
>         <datapath />
>         <handler name="ondata" args="d">
>             // code does stuff based on this.data here
>             Debug.write("ondata", d, this.data);
>         </handler>
>         <text datapath="@name" />
>     </view>
>
>     <simplelayout />
> </canvas>
>
>


-- 
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to