:: Forum >> Version 2 >>

Associate each tabs elements with a AW.HTML.DIV

More information on this topic is available in the documentation section: /aw.ui.tabs/.

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(eventindex){
    
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
Tuesday, May 6, 2008
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
Tuesday, May 6, 2008
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
Tuesday, May 6, 2008

Post a reply:

Text:
Name:

Back to /aw.ui.tabs/

Documentation:

Forum search