wuttrain Posted May 5, 2008 Report Share Posted May 5, 2008 Hi, I have 2 (or more) charts on a page, and I have a HTML select control (1 week; 1 month; 1 year). So when I select 1 month from the list, I'd like to refresh my charts to 1 month data. I have created this function in Javascript, and created the UserCallBack for each chart function Select_OnChange(dropdown) { var myindex = dropdown.selectedIndex;var SelValue = dropdown.options[myindex].value; SFX_SendUserCallback( 'Chart1', myindex ,false);SFX_SendUserCallback( 'Chart2', myindex ,false );} But it seems that only Chart1 is refreshed/reloaded but not Chart2. I am not really familiar with Javascript, so I'm not even sure if calling SFX_SendUserCallback twice will do it. Please let me know. Thanks! wuttrain Quote Link to comment Share on other sites More sharing options...
Frank Posted May 6, 2008 Report Share Posted May 6, 2008 SFX_SendUserCallback is assynchronous. You can not make another call to it untill the first one has finished. What you need to do is make your second call AFTER the first call returns. To do this, you can set: SFX_onCallbackReadyDelegate = function () { SFX_onCallbackReadyDelegate = null;SFX_SendUserCallback('Chart2', 'param' ,false ); }; SFX_SendUserCallback('Chart1', 'param' ,false); Quote Link to comment Share on other sites More sharing options...
wuttrain Posted May 7, 2008 Author Report Share Posted May 7, 2008 I changed the code to this, but it only updates Chart1 and not Chart2: function Select_OnChange(dropdown) { var myindex = dropdown.selectedIndex;SFX_onCallbackReadyDelegate = function () { SFX_onCallbackReadyDelegate = null;SFX_SendUserCallback('Chart2', myindex ,false); }SFX_SendUserCallback('Chart1', myindex ,false ); } Thanks Frank. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.