[Windmill-dev] Issue with click command and preventDefault
Mikeal Rogers
mikeal at osafoundation.org
Fri Dec 14 22:33:58 PST 2007
The goal of the windmill API is to simulate, as close as we possibly
can, real user simulation.
If the way we are calling click isn't propagating through the event
listeners the way a normal user click would, then it's a bug. It may
not be a bug we're able to fix at the end of the day, but it should
still be treated as a bug and probably logged as such.
The only reason you would have to go the extension route is if the
only way to fire this event is some one off hack that works for your
specific case. If it's possible to be more like a real user click we
should try as hard as we can to make it that way.
-Mikeal
On Dec 14, 2007, at December 14, 20079:28 PM, Adam Christian wrote:
> 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
> _______________________________________________
> Windmill-dev mailing list
> Windmill-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/windmill-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/windmill-dev/attachments/20071214/0a026af3/attachment.htm
More information about the Windmill-dev
mailing list