PDA

View Full Version : display-setSrc-bringtofront()?


cat_sin
05-15-2009, 01:28 AM
Hi,

Wanna ask some guidance from u all. Below is the code i write to display the url in the windows and bring the windows to the front:

<canvas debug="true" >
<window width="400" height="400"
oninit="this.win.setSrc('http://www.google.com/')">
<html xoffset="8" yoffset="25" widthoffset="-20"
heightoffset="-45" name="win"
oninit="this.bringToFront()"/>
</window>
</canvas>


when i try to run this code, the window din show the interface of the url and i get compilation warning and an error show:call to undefined method 'setSrc'. I am doubt with this error because the code i used here is exactly same from the "laszlo in action" book. Is there any setting to change or do i need to add dtd for it? Any idea?

Hope to get reply from u all. Ur help is very much appreciated.


Regards,
cat_sin

mjessup
05-15-2009, 04:40 AM
Depending on what version of Laszlo you are using you may need to use setAttribute('src', NEWURL) instead of setSrc(NEWURL). From the amazon page it looks like the book was written for LPS 4.0 and there have been a few significant changes in the API/syntax since then (I have seen other posts where this was an issue.) So if you are using a newer LPS and have problems with an example make sure to check the docs for changes (I didn't see a setSrc in the LPS 4.3.0 docs for the html component).

cat_sin
05-18-2009, 01:48 AM
Hi mjessup,

Thanks for ur guidance. Nw i only noticed there is a difference for different version of it. Thanks a lot.

Regards,
cat_sin