ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Zoom in/out Error
Posted by Krishnan on May-07-2008 15:42
Attachments:
Hi Peter -

I have used the zooming feature of the chartdirector. It works fine.

I get an error while zooming in/out after a long time.

I leave the browser open for 10-20 mins and do nothing. I come back to the open page and try to zoom in/out again. I get the error as displayed in the attached screen shot.

I am not able to figure out why. I guess it has to do something with the Session Time out.


Can you please help me solve the issue?

Best Regards,
-Krish
ParetoZoomError.JPG

  Re: Zoom in/out Error
Posted by Peter Kwan on May-07-2008 18:15
Hi Krishnan,

The error means the web page is trying to ask the server for a new chart using an AJAX request, but the server does not return a new chart. Instead, the server returns what you see on the screen.

In the "Zoomable and Scrollable Chart" sample code, the first thing the code does is to check whether it is a "partial update" or not. If it is a "partial update", it will process the request using the processPartialUpdate function and returns the updated chart.

In your case, there are many reasons. For example, your server may detect that the session has timeout and redirect the user to another page, or require the user to "login" (in case you web page requires "login"). In this case, it is not possible to solve the problem using ChartDirector, because the server does the redirection before ChartDirector is run. You need to configure your web server not to redirect, or you need to configure your web page to disable "partial update" after a certain period.

To diagnose the problem, you need to know why your server outputs what you see on the screen. The output seems to come from your other code, instead of the processPartialUpdate function. For debugging, you may set breakpoints in your code, so you know why the code runs. Sometimes, you may see an error message in the output, which tells you the cause of the problem.

If you need further help, please let me know what is the complete output, and the code that generates the output. You may use IE File/Save As and use the "Web Archive" format to capture what you see on the screen.

Regards
Peter Kwan

  Re: Zoom in/out Error
Posted by Krishnan on May-16-2008 11:22
Hi Peter -

>>For example, your server may detect that the session has timeout and redirect the >>user to another page, or require the user to "login" (in case you web page >>requires "login"). In this case, it is not possible to solve the problem using >>ChartDirector, because the server does the redirection before ChartDirector is run. >>You need to configure your web server not to redirect, or you need to configure your >>web page to disable "partial update" after a certain period.

You are right. The session timeout in our case redirects the user to the login page.

How do I disable the "Partial Update" after a certain period?

Regards,
-Krish

  Re: Zoom in/out Error
Posted by Peter Kwan on May-16-2008 21:14
Hi Krishnan,

The web page will perform a partial update because there are lines your code that ask the web page to perform a partial update. You may modify your code so that it asks the web page to do a full update instead after a certain time.

If your code is based on the sample code, it may have the following lines:

viewer.attachHandler("ViewPortChanged", viewer.partialUpdate);
document.getElementById('SubmitButton').onclick = function() { viewer.partialUpdate(); return false; };

The above line means to perform a partial update if the "view port" is changed, or if the user press the submit button.

You may create a function that performs a partial update only in the first 60 seconds. For example:

var now = new Date().getTime();
function updateChart(viewer) {
    if (new Date().getTime() - now < 60000)
        viewer.partialUpdate();
    else
        //just submit the form, or do any other things you want
        document.forms[0].submit();
}

Then your code can call the above function instead of directly calling partialUpdate.

viewer.attachHandler("ViewPortChanged", function() { updateChart(viewer); });
document.getElementById('SubmitButton').onclick = function() { updateChart(viewer); return false; };

Hope this can help.

Regards
Peter Kwan