Eeeww.. for a workaround in this case, you could always try something feindish in the meantime like setting the id manually through javascript after the page is loaded but before the event listener has a chance to do its thing then use elements instead of target...
or.. if body supports informal parameters (and renders them) then you could just try passing in id = "m_body" and then having the annotation's elements atrribute reference 'm_body' or... muahahah... create a huge freaking div layer at the root of the dom tree (the first and only node under the body |document element (whatever it is dojo.html.body() returns) with width and height 100% and give it an id and...... maybe not? Peace, Josh On 8/16/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
Aha...But there is no id specified on the rendered Body element. :) That is fixable. Can you file a JIRA issue for it? (Though doing a mouseover listener for something as broad as the document Body sounds a little scary....Should be fixed in the Body component either way though I guess...) On 8/16/06, TH <[EMAIL PROTECTED]> wrote: > > i think using this > @EventListener(elements = "myFavoriteDiv", events = > "onmouseover", async=true) > Does not help me either... > > looking at the "View Source" of the browser output it > seem like Dojo is getting configured correctly > > <!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 --> > > It seem like i am doing something really really stupid > :( > > Yes your idea of moving to snapshot builds looks > sensible ... i think i should try this example of the > latest snapshot. > > regards, > > TH > > --- Jesse Kuhnert <[EMAIL PROTECTED]> wrote: > > > Tried this code and it didn't work or tried it and > > it worked great? ;) > > > > FYI, if you are going to use 4.1 you're much better > > off moving to the daily > > snapshot builds of 4.1.1-SNAPSHOT. (via maven2) .. > > It feels like a kind of > > bait and switch, but what can I do? .... > > > > On 8/16/06, TH <[EMAIL PROTECTED]> wrote: > > > > > > Jesse thanks for such a quick reply :) > > > > > > Well i just tried this code too > > > > > > @EventListener(elements = "myFavoriteDiv", events > > = > > > "mouseover") > > > public void watchText(BrowserEvent event) > > > { > > > System.out.println("User clicked on x/y > > coordinates " > > > + event.getPageX() + "/" + event.getPageY()); > > > } > > > > > > > > > http://tapestry.apache.org/tapestry4.1/ajax/EventListener.html > > > > > > --- Jesse Kuhnert <[EMAIL PROTECTED]> wrote: > > > > > > > You can try using the right event keyword to > > start > > > > with ;) > > > > > > > > http://www.quirksmode.org/js/events_mouse.html > > > > > > > > (Maybe I should link quircksmode.org in to the > > main > > > > page so people can more > > > > easily find this handy reference.) > > > > > > > > On 8/16/06, TH <[EMAIL PROTECTED]> wrote: > > > > > > > > > > I have to write some Ajax intensive > > application. > > > > So i > > > > > decided to tryout Tapestry 4.1 > > > > > > > > > > And it seems like i am missing something very > > > > > important ... because i am not able to run > > even > > > > the > > > > > most basic example give :( > > > > > > > > > > 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") > > > > > 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> > > > > > > > > > > Can any body help me out by pointing the > > > > problem???? > > > > > > > > > > regards, > > > > > > > > > > TH > > > > > > > > > > > > > > > > > __________________________________________________ > > > > > Do You Yahoo!? > > > > > Tired of spam? Yahoo! Mail has the best spam > > > > protection around > > > > > http://mail.yahoo.com > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe, e-mail: > > > > [EMAIL PROTECTED] > > > > > For additional commands, e-mail: > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > -- > > > > Jesse Kuhnert > > > > Tapestry/Dojo/(and a dash of TestNG), team > > > > member/developer > > > > > > > > Open source based consulting work centered > > around > > > > dojo/tapestry/tacos/hivemind. > > > > > > > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > > protection around > > > http://mail.yahoo.com > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > === message truncated === > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]