[ http://issues.apache.org/jira/browse/TAPESTRY-1070?page=all ]

Jesse Kuhnert reassigned TAPESTRY-1070:
---------------------------------------

    Assignee: Jesse Kuhnert

> no id specified on the rendered Body element
> --------------------------------------------
>
>                 Key: TAPESTRY-1070
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1070
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 4.1
>         Environment: Java SDK 5.0
> Apache Tomcat/5.5.9
>            Reporter: Tahseen Ur Rehman
>         Assigned To: Jesse Kuhnert
>
> I am trying the basic example of Tapestry 4.1 given on this link 
> http://tapestry.apache.org/tapestry4.1/ajax/EventListener.html
> But the Ajax functionality does not seems to work .... I posted this on the 
> mailing list  and  Jesse Kuhnert suggest that no id for the Body element.
> Browser Output (View Source)
> --------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
> Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd";>
> <!-- Application: null -->
> <!-- Page: Home -->
> <!-- Generated: Thu Aug 17 00:10:00 PKT 2006 -->
> <html>
> <head>
> <meta name="generator" content="Tapestry Application
> Framework, version 4.1"/>
> <meta http-equiv="Content-Type"
> content="text/html;charset=UTF-8"/>
> <base
> href="http://localhost:8080/whiteboard/"/><!--[if
> IE]></base><![endif]-->
> <title>Whiteboard</title>
> <script type="text/javascript">djConfig = { isDebug:
> true, debugContainerId:'debug',
> baseRelativePath:"http://localhost:8080/whiteboard/app?service=asset&path=%2Fdojo%2F";,
> preventBackButtonFix: false, parseWidgets: false };
> </script>
>  <script type="text/javascript"
> src="http://localhost:8080/whiteboard/app?service=asset&path=%2Fdojo%2Fdojo.js";></script><script
> type="text/javascript"
> src="http://localhost:8080/whiteboard/app?digest=70bde2c664cbcfa071d91ccec1438f38&service=asset&path=%2Ftapestry%2Fcore.js";></script>
> <script
> type="text/javascript">dojo.require("dojo.logging.Logger");
> dojo.log.setLevel(dojo.log.getLevel("WARNING"));</script></head>
>   
> <body>
> <script type="text/javascript"><!--
>             dojo.require("dojo.event");
>             dojo.require("tapestry.*");
> // --></script>
>     <div id="myFavoriteDiv">
>       Big brother is watching you ...
>       </div>
>    <script type="text/javascript"><!--
> dojo.event.connect(window, 'onload', function(e) {
>             
>                 dojo.event.connect(dojo.byId("$Body"),
> "onmouseover", function(e) {
>                     var
> content={beventname:"onmouseover"};
>                    
> tapestry.event.buildEventProperties(e, content);
>                     if (!content["beventtarget.id"])
> content["beventtarget.id"]="$Body";
>                     
>                    
> tapestry.bind("/whiteboard/app?component=%24Body&page=Home&service=directevent",
> content);
>                 });
>                
> dojo.event.connect(dojo.byId("myFavoriteDiv"),
> "onmouseover", function(e) {
>                     var
> content={beventname:"onmouseover"};
>                    
> tapestry.event.buildEventProperties(e, content);
>                     if (!content["beventtarget.id"])
> content["beventtarget.id"]="myFavoriteDiv";
>                     
>                    
> tapestry.bind("/whiteboard/app?component=%24Body&page=Home&service=directevent",
> content);
>                 });
> });
> // --></script></body>
> </html>
> <!-- Render time: ~ 985 ms -->
> Home.java
> ---------------
> package whiteboard.pages;
> import org.apache.tapestry.annotations.EventListener;
> import org.apache.tapestry.event.BrowserEvent;
> import org.apache.tapestry.html.BasePage;
> public abstract class Home extends BasePage
> {    
>       @EventListener(elements = "myFavoriteDiv", events ="onMouseOver", 
> async=true)
>       public void watchText(BrowserEvent event)
>       {
>                System.out.println("User clicked on x/y coordinates" + 
> event.getPageX() + "/" + event.getPageY());
>       }
> }
> Home.html
> ----------------
> <html jwcid="@Shell" title="Whiteboard" ajaxEnabled="ognl:true">
>   <body jwcid="@Body">
>     <div id="myFavoriteDiv">
>       Big brother is watching you ...
>       </div>
>    </body>
> </html>
> app.application
> ----------------
> <?xml version="1.0"?>
> <!DOCTYPE application PUBLIC 
>   "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
>   "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd";>
>   
> <application>  
>       <meta key="org.apache.tapestry.page-class-packages" 
> value="whiteboard.pages"/>
> </application>
> web.xml
> ----------------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app version="2.4" 
>       xmlns="http://java.sun.com/xml/ns/j2ee"; 
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
>       http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
>       
>       <display-name>Whiteboard</display-name>
>       
>       <servlet>
>               <servlet-name>app</servlet-name>
>       
>         <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
>               <load-on-startup>0</load-on-startup>
>       </servlet>
>       
>       <servlet-mapping>
>               <servlet-name>app</servlet-name>
>               <url-pattern>/app</url-pattern>
>       </servlet-mapping>
> </web-app>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to