[Windmill-dev] Issue with click command and preventDefault

Adam Christian adam at osafoundation.org
Fri Dec 14 21:28:21 PST 2007


This is an interesting issue indeed. I am going to investigate! worst  
case scenario has you writing an extension, or a modification to the  
click method on windmill. Hopefully we can find some logic to make  
this work ootb.

thanks for the discovery, the web has so many edge cases!

Adam

On Dec 14, 2007, at 8:28 PM, "Robert Leftwich" <windmill at rtl.fmailbox.com 
 > wrote:

> I was trying to test a datatable from YUI and came across a problem  
> with
> the click processing, more specifically the use/timing of
> preventDefault() in the mozController. A sample page for a YUI  
> datatable
> can be found at
> http://developer.yahoo.com/yui/examples/datatable/dt_basic_clean.html
> and the simple test is to click on the sortable headings, i.e.
>
>  {"params": {"id": "yui-dt0-labellink3"}, "method": "click"}
>
> The problem is that the sortable headings are setup to work w/o js and
> as such have a valid href, e.g.
> http://developer.yahoo.com/yui/examples/datatable/dt_basic_clean.html?key=title
> and this href is opened in windmill.controller.click(), with the  
> result
> that the page always reloads after each click on a sortable header.
>
> The reason for this appears to be that although the
> windmill.controller.click() code installs a click listener on the  
> anchor
> element to capture the current preventDefault setting, the YUI code  
> has
> a click listener at the table level, where it calls preventDefault().
> Unfortunately, this is after the Windmill click handler is called, and
> the result is that preventDefault in windmill.controller.click() is
> false, so the href is opened.
>
> I'm not sure of the best way to address this problem as it seems
> unlikely that a coding solution will ever be able to cater for all
> possible combinations of click listeners/bubbling. I wonder if a param
> on the click command that specifies the required preventDefault  
> setting
> would be a more pragmatic approach?
>
> Of course, I'm new to Windmill and may have missed something. If so,
> great, just tell me what I missed and I'll continue on :-)
>
> Robert
>
>
> _______________________________________________
> Windmill-dev mailing list
> Windmill-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/windmill-dev


More information about the Windmill-dev mailing list