3.2.0

Associate each tabs elements with a AW.HTML.DIV

Hello, I want to use tabs to switch between different webpages. Each page is written in a AW.HTML.DIV, and thinking that it is possible to refresh the page. I show you that I have done with a simplified example :

<script>

var result = new AW.HTML.DIV;

var menu = new AW.UI.Tabs;
menu.setItemText(["index0", "index1"]);
menu.setItemCount(2);
menu.setSelectedItems([0]);

menu.onItemClicked = function(event, index){
    getInstantPage(index);
    result.refresh();
};

document.write(menu);

var mainPage0 = new AW.HTML.DIV;
var label0 = new AW.UI.Label;
label0.setControlText("Page 0");
mainPage0.setContent("label0", label0);

var mainPage1 = new AW.HTML.DIV;
var label1 = new AW.UI.Label;
label1.setControlText("Page 1");
mainPage1.setContent("label1", label1);

result = mainPage0;

document.write(result);

function getInstantPage(index){
    switch(index){
        case(0):
            result = mainPage0;
            break;
        case(1):
            result = mainPage1;
            break;
        default:
            break;
        }
}

</script>


In this exemple, the page still block on the page0.

Regards,
G. Caplain
May 6,
Look at the examples that come with the download. There are 3 or 4 examples one of which shows you how to set up divs with the tabs (iframes are another option).

Note that in each case, you don't load a new page but populate a div managed by the tab. In some ways this is akin to using HTML frames but not quite.
Anthony
May 6,
Thanks a lot for your quick answer.

I forgot to see examples and the first example is exactly that I researched. I began to do this type of solution and it is easier with this example.
G. Caplain
May 6,

This topic is archived.

See also:


Back to support forum