[no subject]


I need some help again....

I have a "load information " button and a tab.

When the button is clicked I want to update the tab and then do a table request to the server in this order. (I want the text "loading" at the tab.)

But: The request to the server is always first and then the update of the tab.

How can I change the order, so the tab is updated first and then the request to the server is sent.

July 27,
setTimeout("serverCall()", [a small amount of time]);

Try that - It will delay the server call until the amount of time (in ms) is up. From there use trial and error, I'd say.
July 27,
I did try that, but it did the call, but no delay.

mybutton.onClick=function (){
--(tab update)

I tried with alot of numbers for time(ms), but I did not get any delay.

Any solutions??

I don't know trial and error. Any eksampel??
July 27,
Are you restoring the tab text too soon? You need to restore the tab text in the call back function of the get data request. I think the following simulates what you are trying to do.
<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>
var tabs = new AW.UI.Tabs;
tabs.setItemText(["Home", "Favorites", "Font size", "Search"]);
tabs.setItemImage(["home", "favorites", "fontsize", "search"]);
var btn = new AW.UI.Button;
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)
July 28,
Thanks alot for your help.....

It's asome product.

And I'll be back
August 22,

This topic is archived.

See also:

Back to support forum