glad I could help!
as to wether it needs to be changed - no idea.

Paul


On Mon, Mar 30, 2009 at 10:46 AM, Angrez Singh <ang...@gmail.com> wrote:

> Thanks Paul for the information. Just going through it found that
>
> "If the user clicks an object that can receive the input focus but does not
> already have the focus, the 
> onfocus<http://msdn.microsoft.com/en-us/library/ms536934%28VS.85%29.aspx>event
>  occurs for that object before the
> *onclick* event. "
>
> In my case when I used click "onfocus" event was not getting raised. When i
> explicitly fired "onfocus" event on link and then used link.click() i was
> able to get the desired results.
>
> My question now is, does watir fires "onfocus" event before clicking an
> element? If not, then do we need to change it?
>
> - Angrez
>
>
> On Mon, Mar 30, 2009 at 9:01 PM, Paul Rogers <paul.rog...@shaw.ca> wrote:
>
>> the javascript is probably needing the event object to work correctly. The
>> dom click method generates a click event, but does not add the associated
>> event object, so it works fine for simple things like <a href='
>> www.google.com'>Google</a>
>>
>> The fire_event('onClick') does essentially the same thing,
>>
>> ( 
>> http://msdn.microsoft.com/en-us/library/ms536913(VS.85).aspx<http://msdn.microsoft.com/en-us/library/ms536913%28VS.85%29.aspx>
>> for onclick event)
>> ( 
>> http://msdn.microsoft.com/en-us/library/ms536363(VS.85).aspx<http://msdn.microsoft.com/en-us/library/ms536363%28VS.85%29.aspx>
>> for click method )
>>
>> for more advanced uses, the event object is used. Ive been trying to get
>> this added to watir but just havent had time. As we get richer user
>> interfaces, especially ones using the common libraries like jquery this is
>> going to become more important.
>>
>> Paul
>>
>>
>>
>>
>> On Mon, Mar 30, 2009 at 7:58 AM, Angrez Singh <ang...@gmail.com> wrote:
>>
>>> I am facing a weird problem
>>>
>>> if I click the link manually then i get the desired results but if I use
>>> link.click() then i get javascript errors. Link has href() which points to
>>> some javascript method
>>>
>>> <a href="javascript:changeSelection()">
>>>
>>> Any ideas? or suggestions? to fire the javascript event successfully
>>> using watir?
>>>
>>> - Angrez
>>>
>>>
>>> On Mon, Mar 30, 2009 at 7:20 PM, Angrez Singh <ang...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Can some one explain me the difference? In one of our projects if I do
>>>> link.click() i get javascript errors & if i do link.fire_event("onclick")
>>>> nothing happens.
>>>>
>>>> - Angrez
>>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to