21-Apr-05 (Created: 21-Apr-05) | More in 'laszlo'

laszlo: How to read a dataset from a webserver and paint the contents

What does it do?

Here is how you can make a call to a server for a set of folders and display them in a window.

Approach

1. Define a named dataset pointing the http xml service you have

2. Get a window with width

3. Write multiple lines with each line representing a folder

Concepts used

1. Datapath

2. Dataset

3. Simplelayout

4. Repeated views based on a datapath setting

Script


<canvas height="120">
 <dataset type="http" name="foldersDataSet" 
 	request="true"
    src="http://216.187.231.34//akc/display"
	querystring="url=ShowFiledReportsViewJSPURL&ownerUserId=satya&aspire_output_format=object-xml"/>
<window width="200">
	  <simplelayout spacing="5" axis="y"/>
	  <view datapath="foldersDataSet:/AspireDataSet/FoldersLoop1/row">
	    <simplelayout spacing="2" axis="x"/>
      	<text>+</text>
      	<text datapath="folder_name/text()"/>
	  </view>
</window>	  
</canvas>