|
Zoom/Scroll chart with Database inputs |
Posted by vighneshwar on Nov-25-2010 13:15 |
|
Dear Friends,
Please help me.
I want to give dynamic inputs to this charts ... but iam unable ...
In this example also given static inputs ...
I will be kept some drop down boxes above this code based on the selection of drop down box the page will refresh, so those input arrays will taken from database on selection of drop down. so the inputs will be change ....
in this scenario this charts are not working ...
Thanks in advance,
Regards,
Vighneshwar. |
Re: Zoom/Scroll chart with Database inputs |
Posted by Peter Kwan on Nov-26-2010 00:37 |
|
Hi vighneshwar,
You mentioned there are some "drop down boxes" and that you need to get data from the database.
The "drop down boxes" exist only on the browser side. However, the database code is on the server side. So you must use some method to pass the selection in the "drop down boxes" from the browser to the server. Would you mind to clarify how to pass this information from the browser to the server?
For a normal HTTP request created by your code, your code may use HTTP GET or POST. However, for AJAX requests, it may or may not use HTTP GET or POST (it depends on your browser band, version, configuation, etc). Also, the AJAX request will not automatically include everything that exists on your web page. To pass data in AJAX request, it is suggested you use "custom AJAX attributes".
If you are using the "Zooming and Scrolling Demonstation" sample code that comes with ChartDirector, you can see there are many "drop down boxes" in the sample code. You may refer to the sample code to see how their values are being passed to the server.
In brief, in the sample code, there is a variable called "controlsToSync" which lists the HTML controls that should be passed to the server during AJAX requests. Please list your HTML control there if you want it to be accessible during AJAX requests.
On the server side, during AJAX request, the field would then be accessible as:
//assume xxxx is the id of your field
String myField = viewer.getCustomAttr("xxxx");
Note that the above is only for AJAX request. For the initial HTTP request, you should continue to use your existing method to pass data (eg. by GET, POST, cookie, .....).
Hope this can help.
Regards
Peter Kwan |
|