cdickson
02-12-2003, 04:39 PM
Hi,
During the running of my application,
I am making an HTTP Request on a button click (code not shown) and getting back xml data similar to the following for my dataset:
<keyset>
<key value="bob"/>
<key value="joe"/>
<key value="mike"/>
</keyset>
With this dataset, i want to create a stack of text views displaying those names. The approach i was taking is shown below. However, this was not working. Is there a better approach?
<view name="MainView>
<datapointer name="keysetDI" xpath="keysDataset:/" ondata="MainView.someMethod()"/>
<method="someMethod">
var keysDP = MainView.keysetDI.getXPath('keyset');
Debug.write(keysDP.serialize()); // i have verified my dataset with this statement
var myClass = new MyClass( this, {datapath:keysDP} );
</method>
</view>
<library>
<class name="MyClass" height="40" bgcolor="yellow" font="Helvetica" fontsize="20" visible="true" >
<text name="key" width="300" datapath="key[-5]" ondata="this.setText( '@value' ) "/>
<simplelayout axis="y" spacing="10"/>
</class>
</library>
Thanks!
Clint Dickson Software Engineer
p 415.875.7061 f 415.875.7001 cdickson@semaphorepartners.com
.................................................. .................................................. ....................
Semaphore Partners www.semaphorepartners.com
During the running of my application,
I am making an HTTP Request on a button click (code not shown) and getting back xml data similar to the following for my dataset:
<keyset>
<key value="bob"/>
<key value="joe"/>
<key value="mike"/>
</keyset>
With this dataset, i want to create a stack of text views displaying those names. The approach i was taking is shown below. However, this was not working. Is there a better approach?
<view name="MainView>
<datapointer name="keysetDI" xpath="keysDataset:/" ondata="MainView.someMethod()"/>
<method="someMethod">
var keysDP = MainView.keysetDI.getXPath('keyset');
Debug.write(keysDP.serialize()); // i have verified my dataset with this statement
var myClass = new MyClass( this, {datapath:keysDP} );
</method>
</view>
<library>
<class name="MyClass" height="40" bgcolor="yellow" font="Helvetica" fontsize="20" visible="true" >
<text name="key" width="300" datapath="key[-5]" ondata="this.setText( '@value' ) "/>
<simplelayout axis="y" spacing="10"/>
</class>
</library>
Thanks!
Clint Dickson Software Engineer
p 415.875.7061 f 415.875.7001 cdickson@semaphorepartners.com
.................................................. .................................................. ....................
Semaphore Partners www.semaphorepartners.com