Hi all,


 i try to set up an iframe in a jsp(portal.jsp) and wrap a

 lzx(webtop.lzx) in it. However, in webtop.lzx, when i try to call the

 outer user-defined js funtion through callJS, it failed to execute my

 function.

 webtop.lzx:

 <canvas>

    <attribute name="webtopView"/>

    <handler name="onwebtopView">

        LzBrowser.callJS("webtopChangedView", null, "summary/full");

    </handler>

    <view  height="100" bgcolor="blue" name="webtop">

        <button name="mybutton" text="button">

            <handler name="onclick">

                Lz.setCanvasAttribute("webtopView", "summary");

            </handler>

        </button>

    </view>

 </canvas>

 portal.jsp:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

 ">

 <html>

 <head>

 <meta http-equiv="Content-Type" content="text/html; charset=utf8" />

 <title>Portal</title> <script language="javascript"

 type="text/javascript"> function webtopChangedView(view) {

    if (view == "summary") {//change widget to summary size

         alert("Summary:" + view);

     }else { //change widget to standard size

        alert("standard:" + view);

     }

 }

 </script>

 </head>

 <body>

 Portal view

 <iframe src="webtop.lzx" width="100%" height="700px"> </iframe>

 </body> </html>





 but if i changed LzBrowser.callJS("webtopChangedView", null,

 "summary/full")  to call a primitive window function like

 LzBrowser.callJS("window.open", null, "summary/full"), it did execute,

 so my question is how to invoke outer use-defined js function in an

 iframe wrapped lzx. I couldn't get help from both reference guide or

 openlaszlo forum. Thanks for your time.



 Regards.

 captain

Reply via email to