3.2.0

Setting links in tab not working

I uncommented out the following section of the tabs.html quick-ref example:

/********************************************************************
item templates
********************************************************************/

obj.setItemTemplate(new AW.Templates.Link); // hyperlink template
obj.setItemLink("http://www.google.com", 1); // URL for item 1

According to this, once I click on tab 1 then I should be redirected to Google, but nothing happens. Is there something missing?
Adam Liebergen
April 13,
Sorry, thats my fault, those lines should not be in tabs.htm quick ref because link template is not compatible with tabs control. I guess they just were copied from List examples by mistake.

If you want to navigate to another page on tabs click, here is the example -

var obj = new AW.UI.Tabs;
    obj.setItemText("google", 1);
    obj.setItemCount(10);
    obj.setSelectedItems([5]);

    obj.onItemClicked = function(event, i){
        window.location = "http://www.google.com";
    }

    document.write(obj);


You can also keep the URLs in item link property -

var obj = new AW.UI.Tabs;
    obj.setItemText("google", 1);
    obj.setItemLink("http://www.google.com", 1);
    obj.setItemCount(10);
    obj.setSelectedItems([5]);

    obj.onItemClicked = function(event, i){
        window.location = this.getItemLink(i);
    }

    document.write(obj);
Alex (ActiveWidgets)
April 17,

This topic is archived.

See also:


Back to support forum