This is a migrated thread and some comments may be shown as answers.

Problem with NavigateUrl and ImageUrl Together

8 Answers 103 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Jim Johnstone
Top achievements
Rank 1
Jim Johnstone asked on 22 Apr 2008, 09:18 PM
I have just started using the RadToolBar from the Q1 2008 release.  It seems that when I set both the ImageUrl and the NavigateUrl for a RadToolBarButton, no navigation happens when the button is clicked on.  If I only have Text, the Navigate works properly.

Any ideas?

Thanks!

Jim

8 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 23 Apr 2008, 08:07 AM
Hi Jim,

I just checked that and I was not able to reproduce the problem. Please, find attached the page I used. Can you please, check if I am missing something?

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jim Johnstone
Top achievements
Rank 1
answered on 23 Apr 2008, 01:03 PM
Erjan,

I have the same problem with your example.  I did dig further and if the click on the button is not right on the actual image, then it works.  So, in your example, if I click right on the green box, nothing happens.  If I click on the text Telerik or if I click just outside the green box, it works.  Also, FireFox appears to work just fine in all cases.  I am having the problem in both IE6 and IE7.

Any help is appreciated.

Jim
0
Erjan Gavalji
Telerik team
answered on 23 Apr 2008, 04:15 PM
Hi Jim,

I'm sorry for misleading you in my previous post. It seems that I tested using a version of the Telerik.Web.UI suite, different than the official one. Indeed, we isolated the bug and we are working on fixing it. Let me know if you'd like an earlier fix and I will send it to you once ready (for a developer version, please, open a formal support ticket).

P.S. Your Telerik account is updated.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Alex Gyoshev
Telerik team
answered on 25 Apr 2008, 11:43 AM
Hello Jim Johnstone,

As a temporary solution, you could add the following script to your page:
<script type="text/javascript"
function pageLoad() 
    function navigateAction() 
    { 
        if (window.event.srcElement.tagName == "IMG"
        { 
            var link = this.parentNode.parentNode.parentNode.parentNode; 
             
            link.click(); 
        } 
    }; 
     
    if ($telerik.isIE) 
    { 
        var toolbar = $find('<%= radToolBar2.ClientID %>'); 
         
        var items = toolbar.get_items(); 
         
        for (var i = 0, len = items.get_count(); i < len; i++) 
        { 
            var item = items.getItem(i);  
                         
            if (Telerik.Web.UI.RadToolBarButton.isInstanceOfType(item)) 
            { 
                var url = item.get_navigateUrl(); 
                var img = item.get_imageElement(); 
                 
                if (img && url != "#" && url != "none"
                { 
                    img.onclick = navigateAction; 
                } 
            } 
        } 
    } 
</script> 

This will cause the image to delegate the js event (that it doesn't).

Best wishes,
Alex
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Maxime
Top achievements
Rank 2
answered on 19 Aug 2008, 06:28 PM
Hi,

I'm using Q2 and still have the same issue, is it normal this hasn't been fixed yet? (note this seems to be fine in IE7, but still isn't working in IE6)


And by the way, the code supplied bellow doesn't work for me, but i'm using this in a master page... the controls ids are fine..., it doesn't seem to be called at all... or plainly just not working :(
0
Alex Gyoshev
Telerik team
answered on 20 Aug 2008, 09:01 AM
Hi Maxime,

Could you please open a support ticket and attach a sample solution that demonstrates the problem so that we can investigate it?

All the best,
Alex
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
thepilsbury
Top achievements
Rank 1
answered on 16 Oct 2008, 04:25 PM
Has this been resolved?

I am using the latest build and have the same behaviour in IE7 under Windows Server 2003. Clicking on the text works.. clicking on the image doesn't.
0
Helen
Telerik team
answered on 17 Oct 2008, 12:16 PM
Hello,

We tried to reproduce the problem locally with the latest official version - Q2 2008 SP2, but couldn't. Please find attached a sample project as part of our local tests(it contains trial dll's).

Could you test it at your side? Does it work?

If your case is different could you modify our project so we to be able to reproduce the problem?

Regards,
Helen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolBar
Asked by
Jim Johnstone
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Jim Johnstone
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Maxime
Top achievements
Rank 2
thepilsbury
Top achievements
Rank 1
Helen
Telerik team
Share this question
or