"w2" is not defined from where you are trying to access it.
Either define it somewhere global, or use a an object registry like
http://sourceforge.net/mailarchive/message.php?msg_id=15660614
which let's you assign names to objects and retrieve them by their name.
The latter might be more convenient.
Hth,
Danny
On 7/30/06, Jon Fawcett <[EMAIL PROTECTED]> wrote:
I have some dynamically added widgets that are generated from php code
that returns _javascript_ via QxRequest. The new widgets get displayed
fine, but when trying to remove them later, I receive a "[widgetname]"
is not defined error in my debugger window. Any pointers to what I'm
doing wrong?
Thanks,
Jon
Here's some very simple sample code that produces the problem I'm
experiencing. :
------------------------------------------------------------
index.html
------------------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"" xml:lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-15" />
<title>Test</title>
<script type="text/_javascript_"
src=""
</head>
<body>
<script type="text/_javascript_">
window.application.main = function()
{
var main = this.getClientWindow().getClientDocument();
var w1 = new QxCanvasLayout();
w1.setBackgroundColor(new QxColorObject("threedface"));
w1.setWidth(300);
w1.setHeight(150);
w1.setBottom(20);
w1.setRight(20);
w1.setPadding(10);
w1.setOpacity(1);
w1.setBorder(QxBorderObject.presets.inset);
main.add(w1);
var b = new QxButton("open");
b.setTop(0);
b.setLeft(0);
b.setWidth(100);
b.addEventListener("click", functionOpen);
w1.add(b);
var b2 = new QxButton("close");
b2.setBottom(0);
b2.setRight(0);
b2.setWidth(100);
b2.addEventListener("click", functionClose);
w1.add(b2);
function functionOpen(e){
var req = new QxRequest("open.html", "GET", "text/plain");
req.addEventListener("completed", function(e) {
eval(e.getData ().getContent());
});
req.send();
};
function functionClose(e){
var req = new QxRequest("close.html", "GET", "text/plain");
req.addEventListener ("completed", function(e) {
eval(e.getData().getContent());
});
req.send();
};
}
</script>
</body>
</html>
-------------------------------------------------------------------
Close.html
-------------------------------------------------------------------
var w2 = new QxCanvasLayout();
w2.setBackgroundColor(new QxColorObject("threedface"));
w2.setWidth(300);
w2.setHeight(150);
w2.setTop(20);
w2.setLeft(20);
w2.setPadding(10);
w2.setOpacity(1);
w2.setBorder(QxBorderObject.presets.inset);
main.add(w2);
-------------------------------------------------------------------
Open.html
-------------------------------------------------------------------
main.remove(w2);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
--
Danny W. Adair
Director
Unfold Limited
New Zealand
Talk: +64 4 472 1679
Fax: +64 4 472 1680
Write: [EMAIL PROTECTED]
Browse: www.unfold.co.nz
Visit/Post: 22a Clifton Terrace, Kelburn 6005, Wellington, New Zealand
==============================
Caution
The contents of this email and any attachments contain information which is CONFIDENTIAL and may be subject to LEGAL PRIVILEGE. If you are not the intended recipient, you must not read, use, distribute, copy or retain this email or its attachments. If you have received this email in error, please notify us immediately by return email or collect telephone call and delete this email. Thank you. We do not accept any responsibility for any changes made to this email or any attachment after transmission from us.
==============================
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
