<html>
<head>
<title>Test Tabs</title>
<link rel="stylesheet" href="../activewidget/runtime/styles/aqua/aw.css" type="text/css" />
<script language="javascript" type="text/javascript" src="../activewidget/runtime/lib/aw.js"></script>
</head>
<boby>
<script>
var tabs = new AW.UI.Tabs;
tabs.setItemText(["Home", "Favorites", "Font size", "Search"]);
tabs.setItemImage(["home", "favorites", "fontsize", "search"]);
tabs.setItemCount(4);
tabs.setSelectedItems([0]);
document.write(tabs);
</script>
<p/>
<script>
var btn = new AW.UI.Button;
btn.setControlText("Button");
btn.setControlImage("favorites");
document.write(btn);
var saveTabText
btn.onClick = function(event) {
var currentItem = tabs.getCurrentItem();
saveTabText = tabs.getItemText(currentItem)
tabs.setItemText("loading...", currentItem)
// simulate call to get data (
window.setTimeout(callbackComplete, 1000);
// dont do this - restores text to early
// tabs.setItemText(saveTabText, currentItem)
}
// this is the get data callback complete function (i.e. data now loaded)
function callbackComplete() {
var currentItem = tabs.getCurrentItem();
tabs.setItemText(saveTabText, currentItem)
}
</script>
</body>
This topic is archived.