Hey Sven,
2010/8/3 Sven Knoblich <[email protected]>:
> Hello all,
> i want to use ext::button's within my implementation. Therfore i copy all the
> necessary JS-files within /ext/ and add this to my project as it mentioned in
> the description
> "http://www.webtoolkit.eu/wt/doc/reference/html/group__ext.html#_details".
>
> -ext-2.x/adapter/ext/ext-base.js to extBaseURL/ext-base.js
> -ext-2.x/ext-all.js to extBaseURL/ext-all.js
> -ext-2.x/resources/ to extBaseURL/resources/ (the entire folder)
>
> This fix the most of the errors immediately except of one. The element
> 'timer' could not be found.
>
> Error:
> [Chrome]: "Uncaught TypeError: Cannot read property 'timer' of undefined"
> [IE8]: 'timer' is null or not an object
>
> Any ideas?
Although I could not reproduce the problem, I did spot a possible reason.
Does the patch in attachment help ?
Regards,
koen
commit cbe8e5a11604a3e5174f7f521011cce5b13494db
Author: Koen Deforche <[email protected]>
Date: Thu Aug 5 15:40:01 2010 +0200
fix WTimer javascript trouble
diff --git a/src/Wt/Ext/Container.C b/src/Wt/Ext/Container.C
index 4c8c0ae..a160ca7 100644
--- a/src/Wt/Ext/Container.C
+++ b/src/Wt/Ext/Container.C
@@ -209,6 +209,9 @@ void Container::createConfig(std::ostream& config)
if (inWtLayout())
config << ",style:'position:absolute;'";
+ } else {
+ // because it is relative it sets over the actual interface.
+ app->domRoot()->resize(0, 0);
}
if (widget_)
diff --git a/src/Wt/WTimerWidget.C b/src/Wt/WTimerWidget.C
index 9f03376..4075bc2 100644
--- a/src/Wt/WTimerWidget.C
+++ b/src/Wt/WTimerWidget.C
@@ -30,7 +30,7 @@ DomElement *WTimerWidget::renderRemove()
e->callJavaScript
("{"
"""var obj=" + jsRef() + ";"
- """if (obj.timer) {"
+ """if (obj && obj.timer) {"
"" "clearTimeout(obj.timer);"
"" "obj.timer = null;"
"""}"
diff --git a/src/web/skeleton/Wt.js b/src/web/skeleton/Wt.js
index bf70059..62d3bee 100644
--- a/src/web/skeleton/Wt.js
+++ b/src/web/skeleton/Wt.js
@@ -1622,7 +1622,8 @@ function addTimerEvent(timerid, msec, repeat) {
obj.timer = null;
obj.tm = null;
}
- obj.onclick();
+ if (obj.onclick)
+ obj.onclick();
}
};
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest