All pastes #987291 Raw Edit

Something

public text v1 · immutable
·published 2008-04-16 12:34 UTC
rendered paste body
orange$ cat > lines.txt
-------
orange$ cat \
    context/WEB-INF/ExampleComponentContainer.html lines.txt\
    context/WEB-INF/ExampleComponentContainer.page lines.txt\
    src/ajaxsandbox/ExampleComponentContainer.java
<html jwcid="@Shell" title="Load Customer">
    <body>
        <div id="myFavouriteDiv">
            myFavouriteDiv
        </div>
    </body>
</html>

-------
<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
  "-//Apache Software Foundation//Tapestry Specification 4.1//EN"
  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_1.dtd">

<page-specification class="ajaxsandbox.ExampleComponentContainer">

</page-specification>

-------
package ajaxsandbox;

import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.annotations.Bean;
import org.apache.tapestry.annotations.EventListener;
import org.apache.tapestry.html.BasePage;
import org.apache.tapestry.event.BrowserEvent;

public abstract class ExampleComponentContainer extends BasePage {
    @EventListener(elements = "myFavouriteDiv", events = "onmouseover")
    public void watchText(BrowserEvent event) {
        System.out.println("Are you watching?!?");
    }
}


orange$


HTML from a render (onmouse doesn't do anything)
==================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- Application: AjaxSandbox -->
<!-- Page: ExampleComponentContainer -->
<!-- Generated: Wed Apr 16 13:32:47 BST 2008 -->
<html>
<head>
<meta name="generator" content="Tapestry Application Framework, version 4.1.5" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Load Customer</title>
<script type="text/javascript">djConfig = {"baseRelativePath":"/AjaxSandbox/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.5%2F","parseWidgets":false,"locale":"en-gb"} </script>

<script type="text/javascript" src="/AjaxSandbox/app?service=asset&path=%2Fdojo-0.4.3-custom-4.1.5%2Fdojo.js"></script>
<script type="text/javascript">
dojo.registerModulePath("tapestry", "/AjaxSandbox/app?service=asset&path=%2Ftapestry-4.1.5%2F");
</script>

<script type="text/javascript" src="/AjaxSandbox/app?service=asset&path=%2Ftapestry-4.1.5%2Fcore.js"></script>
<script type="text/javascript">
dojo.require("tapestry.namespace");
tapestry.requestEncoding='UTF-8';
</script>
</head>
    <body>
        <div id="myFavouriteDiv">
            myFavouriteDiv
        </div>
    </body>
</html>
<!-- Render time: ~ 48 ms -->