PDA

View Full Version : using the xml data generated by jsp file


hilal7306
07-07-2006, 03:03 AM
Hi,
I'm trying to do smt similar to the form example but in my application I don't need to use the submit button I'm just creating my xml data with
out.println("bla bla"). I'll change it and try to get the data from a database after I solve this problem.
My lzx file is:



<canvas title="Tree Example" bgcolor="#eaeaea" debug="true" width="830" height="700">

<include href="lz/tree.lzx" />
<include href="lz/slider.lzx" />

<greenstyle name="greencolors" canvascolor="null"/>
<goldstyle name="goldcolors" canvascolor="null"/>

<class name="mytree" extends="tree" expander="lztree_plusminus_rsc" open="true" />

<dataset name="mydata" src="http://127.0.0.1:8080/lps-3.3.1/examples/components/resource.jsp" />

<view x="20" y="20">
<simplelayout axis="x" spacing="10" />
<view width="250" layout="spacing: 10">
<view width="210" height="40" bgcolor="white">
<view bgcolor="#EAEAEA" layout="spacing: 2" x="2" y="2"
width="${parent.width - 4}" height="${parent.height - 4}">
<text>Double-click files for information</text>
<text>on network status.</text>
</view>
</view>

<!-- Root node is opened and subtree is recursed with * datapath.
Multiple trees can be selected. Use the lztree_folder_rsc that
comes shipped in lz/tree.lzx. -->
<tree style="goldcolors" datapath="mydata:/response"
text="$path{'@name'}" multiselect="true">
<tree id="xxx" datapath="*" text="$path{'@name'}" isleaf="$path{'@isleaf'}" >
<method event="onactivate">
if (this.isleaf) {
deneme.setVisible(true)
}
</method>
</tree>
</tree>
</view>
</view>

</canvas>

AND MY JSP FILE IS:
<?xml version="1.0"?>

<%@ page import="java.util.*" %>
<%@ page contentType="text/xml; charset=UTF-8" %>


<response>

<%


out.println("<data name='bolgeler'>");
out.println("<bolge name='Marmara' isopen='false'>");
out.println("<sehir name='Istanbul' >");
out.println("<sube name='Kadikoy'>");
out.println("<sistem name='sistem 1' isleaf='true' />");
out.println("<sistem name='sistem 2' isleaf='true' />");
out.println("<sistem name='sistem 3' isleaf='true' />");
out.println("</sube>");
out.println("<sube name='Uskudar'>");
out.println("<sistem name='sistem 1' isleaf='true' />");
out.println("<sistem name='sistem 2' isleaf='true' />");
out.println("<sistem name='sistem 3' isleaf='true' />");
out.println("</sube>");
out.println("</sehir>");
out.println("</bolge>");
out.println("<bolge name='Ege' >");
out.println("<sehir name='Izmir'>");
out.println("<sube name='Bornova' >");
out.println("<sistem name='sistem 1' isleaf='true' />");
out.println("<sistem name='sistem 2' isleaf='true' />");
out.println("<sistem name='sistem 3' isleaf='true' />");
out.println("</sube>");
out.println("<sube name='Karsiyaka'>");
out.println("<sistem name='sistem 1' isleaf='true' />");
out.println("<sistem name='sistem 2' isleaf='true' />");
out.println("<sistem name='sistem 3' isleaf='true' />");
out.println("</sube>");
out.println("</sehir>");
out.println("</bolge>");
out.println("</data>");
%>

</response>


The problem is I can't see my tree when I run the lzx file. I'm quite new with programming. I'll be glad if someone can help me,
Thanks in advance,
Hilal

hilal7306
07-07-2006, 04:10 AM
Hi,
I realised that someone has already came across with a similar problem which is solved by adding request="true" inside dataset,

lassvg
07-13-2006, 11:58 AM
Hi
I am also trying to display a tree from dynaic data,and I tried running this code with request="true".But it shows only the first node.Did you get any solution to your problem.If so pls let me know.
Thanks in advance.