Refresh Button

This is probably going to sound easy for a lot of people, but it has me stumpted.

I have a AW.Button that I am trying to make refresh the window or redirect to a different page:
var btn = new AW.UI.Button;
    btn.onControlClicked = function(event){
        window.location.href = "index.php";	

For some reason nothing happens when I click the button. As far as location in my code, this script is right above the ending body tag. No other scripts are below this one. You will also notice that I am not writing the button to the page. That is being done in another function.

Any hints??
Aaron Todd
January 29,
This doesnt seem like the best solution, but
inside the onControlClicked function seems to work for me. I have no idea why the
window.location.href = "index.php"
didn't work.
Aaron Todd
January 29,
This is strange. The code below works fine -

var btn = new AW.UI.Button;
btn.onControlClicked = function(){
    window.location.href = "http://www.google.com";

Alex (ActiveWidgets)
January 29,

I think its more of a javascript issue and not a problem with the button or how the button works.

I am defigning the button and then in another function am writing it to the page.
Aaron Todd
January 30,
Aaron, I think I'm doing something similar to what you want.
If you look at the page below, I have an "auto refresh" checkbox and a Refresh button.

If you want to see it move "faster" (and not wait), drag part way down the grid. Then just click the "Refresh" button.

All the code is on the page, so you should be able to see what I'm doing. If it's confusing, just write me - I had a co-op tinkering with some things that aren't live yet.

February 3,

This topic is archived.

See also:

Back to support forum


Version 2

Looking for AW 2.6 ?
The old site is here.