PDA

View Full Version : Form does not clear when loading a new form


KASPERO GP
03-08-2007, 02:28 PM
Greetings.

I have a main window that has a menu with two menuitems. On click od the menuitem a form is loaded (form A or form B depending on menuitem clisked) , the first form (form A) loads fine but when I go to the menu and select another menuitem (to load form B) form A is not cleared and still appears on the window. I tried calling the init function on the window on click of menu item but it still does not clear the form.

form A is a class in query_service_order.lzx file.
form B is a class in view_ports_by_date.lzx file.

Here's how the code looks:

<?xml version="1.0" encoding="UTF-8" ?>
<canvas title="Open Xcellence IT Solutions..." debug="true" width="1000" height="500">
<view resource="../images/open_xcellence_bg.jpg" />
<include href="signup.lzx" /> <!-- This library contains the login page -->
<include href="query_service_order.lzx" /> <!-- This library contains the login page -->
<include href="view_ports_by_date.lzx" /> <!-- This library contains the ports page -->
<splash persistent="true">
<!--view resource="../images/virgin_mobile.jpg" /-->
</splash>
<!--simplelayout spacing="2" /-->

<!-- This is the main form/window. It cannot be dragged or resized. -->
<window bgcolor="silver" allowdrag="false" name="main_window" x="${ (parent.width - this.width)/2 }" height="${ (parent.height )}" title="Open Xcellence IT Solutions" width="${parent.width - 200}" >


<menubar x="${ (parent.width - this.width)/2 }" name="mbar" placement="menubar" bgcolor="maroon" fontstyle="bolditalic" font="Verdana" >
<!-- The subscriber profile menu - START-->



<!-- The reprocessing menu - START-->
<menu name="so" id="mSO" attach="right">Monitoring
<menuitem text="Service Orders" id="SO_MONITORING">
<method event="onclick">
<!-- var a = new signupform(canvas.main_window, {name: "my_loginview", id:"my_loginview" }); -->
Debug.write("Initialising...");
canvas.main_window.init();
var a = new querySO(canvas.main_window, {name: "my_querySO", id:"my_querySO" });
</method>
</menuitem>
<menuitem text="View Ports By Date" id="PORT_BY_DATE">
<method event="onclick">
Debug.write("Initialising...");
canvas.main_window.init();
var a = new queryPorts(canvas.main_window, {name: "my_queryPorts", id:"my_queryPorts" });
</method>
</menuitem>
<menuitem text="Service Order Statistics" id="SO_STATS"/>
<menuitem text="Pending Recharges" id="ATM_MONITORING"/>
</menu>
<!-- The reprocessing menu - END-->
</menubar>


<!-- The reprocessing menu - END-->
</menubar>
</window>
</canvas>