I can't reproduce your issue with this small testcase, so may you provide a more detailed sample where it fails?

- André

<canvas debug="true" >
<class name="testcase" extends="node" >
        <dataset id="baz" name="dtsModel" />
<node> <datapointer name="ptModel" xpath="local:classroot.dtsModel:/" rerunxpath="true" /> <handler name="oninit" >
                var pt = this.ptModel;
                pt.addNode('foo' , '' , {bar:'hello'});
                Debug.write(this.ptModel.serialize());
            </handler>
        </node>
    </class>
<testcase /> </canvas>


On 6/3/2008 9:00 PM, [EMAIL PROTECTED] wrote:
Hi folks...

I?m trying to add some datapointers in my app.
I always use datapointers but I get access to them using the
lzDataset.getPointer method... My dataset is located inside of a class.
The code is as follows:

My dataset.

<dataset name="dtsModel" />

My Pointer

<datapointer name="ptModel" xpath="local:classroot.dtsModel:/"
rerunxpath="true" />

In the init method of my class I call the method initModel... This method
create the XML nodes that are binding to the user interface...

<method name="initModel" ><![CDATA[
     var pt = this.ptModel;

     pt.addNode( 'tipo-contato' , '' , {codTipoContat:'', desTipoContat:'',
sigTipoContat:''} );

     Debug.write( this.ptModel.serialize() );
]]></method>

When I try to invocate a method in my datapointer, the debug screen prints
the message: INFO @forms/CRMParametrosTipoContato.lzx#19: serialize: p is
null in LzDatapointer  name: ptModel

What is happen ?
In the openlaszlo doc the code is simple like this, and it doesnt workin....

Thanks in advance.
Rodrigo Kerkhoff

Reply via email to