PDA

View Full Version : JPG not appears (file name generated from database)


wolfatwork
10-15-2004, 06:30 AM
Can someone please help me out?

The imgsrc is retrieving from the database. I have verified that I get the correct parameter as text, but when I do this <text resource="$path{'detail/text()'}">, the graphic is not showing up at all, why?

I have one more question about generating a website by pulling information from database. The database stores all the html code. Is there a easy way to do that in LZX since it will not accept any code like <a href=""...

You have to change it to &lt;a href=&quot; in order for the link to show up in LZX environment.

Is there an easy way to tackle these kind of problems?

Thanks,

Jimmy
<canvas height="500">
<dataset name="eset"
autorequest="true" type="http"
src="/jtrh/homepage.asp?section=features"/>
<simplelayout axis="y" spacing="15"/>
<view x="20"></view>

<text datapath="eset:/features/content" text="$path{'detail/text()'}" width="250" multiline="true"/>
<view datapath="eset:/features/content">
<method event="onload">
this.resource=this.datapath.xpathQuery( 'imgsrc/text()' );
Debug.write (this.datapath.xpathQuery( 'imgsrc/text()' ));
</method>
</view>
</canvas>

metasarah
10-15-2004, 07:28 AM
There are a couple of problems with your code

(1) To change the resource, you need to call setResource, or setAttribute('resource', ...) Merely setting the Javascript property will not have any effect. While this is fine syntax for setting your own flags, its usually not what you mean to do in LZX

(2) use setResource for internal compiled resources, to set from a file (loaded dynamically at runtime) use setSource()

For me detail see the view reference:
http://www.laszlosystems.com/lps-2.2/docs/reference/index.html?view.html

Good luck!

Sarah

wolfatwork
10-19-2004, 11:41 AM
First of all, thanks for your help. However, here is the problem again:
Output from some jsp
<features>
<content>

<detail>It's here! The Parks, Recreation and Culture Fall Leisure Guide is now on-line. </detail>
<jimsrc>fall_leisure_guide.jpg</jimsrc>
<jimmytest>300</jimmytest>

</content>
</features>

<canvas>
<view datapath="eset:/features/content" name="testsrc"
width="$path{'jimmytest/text()'}"
height="$path{'jimmytest/text()'}"
resource="$path{'jimsrc/text()'}"
>
</view>
</canvas>

The width and height are reading correctly but not the
picture is still not showing up, can you help me out?

Thanks,

Jimmy