AJAX Framework Showcase
TWikiAjaxFramework examples.
Code on this page
<script type="text/javascript">
// <![CDATA[
var TWiki = {}; // should be in twiki.js
// ]]>
</script>
<script type="text/javascript" src="%PUBURL%/Codev/TWikiAjaxFramework/yahoo.js"></script>
<script type="text/javascript" src="%PUBURL%/Codev/TWikiAjaxFramework/connection.js"></script>
<script type="text/javascript" src="%PUBURL%/Codev/TWikiAjaxFramework/twiki_html.js"></script>
<script type="text/javascript" src="%PUBURL%/Codev/TWikiAjaxFramework/twiki_request.js"></script>
<script type="text/javascript" src="%PUBURL%/Codev/TWikiAjaxFramework/behaviour.js"></script>
<script type="text/javascript">
// <![CDATA[
TWiki.Request.indicatorHtml = "<img src='%PUBURL%/Codev/TWikiAjaxFramework/indicator.gif' alt='' />";
var toolsTopic = "TWikiAjaxFrameworkShowcaseTools";
var toolsTopicUrl = "%SCRIPTURL{view}%/Codev/" + toolsTopic;
var myrules = {
'#expandWebBtn' : function(el) {
el.onclick = function() {
TWiki.Request.updateElementWithId("weblist", "expandedWebs", toolsTopicUrl + "?skin=text;section=weblist");
return false;
}
}
};
Behaviour.register(myrules);
// ]]>
</script>
Web list
I've stealed this idea straigt from
MiniAhah, albeit simpler in this example: no toggle back.
Code:
TWiki.Request.draw("weblist", "expandedWebs", "%SCRIPTURL{view}%/Codev/TWikiAjaxFrameworkShowcaseTools?skin=text;section=weblist");
Generates:
TWiki
Note: TWiki currently does not accept the url param section to pass to the view script.
Discussion
Strange. It seems I cannot pass the url parameter
section here on twiki.org.
- Not strange at all. The
view script (see doc
) does not take a section parameter as of TWiki4, while %INCLUDE% does. Maybe we'll come to the conclusion that these are useful extensions for EdinburghRelease, but for now you'll have to work around with an intermediate topic as "AJAX server" to map urlparams to TWiki sections (like I've done in my showcase at http://munich.pm.org/cgi-bin/view/Tools/MiniAHAH
). I'll copy my demos to twiki.org.
-- HaraldJoerg - 31 May 2006
--
ArthurClemens - 31 May 2006