Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by josephtan2k on Nov 21, 2007 19:01
open dhtmlx forum
problim with loading xml

hi,

i have this problem with loadXML("xml.xml") function.

i am using jsp, javascript java..

first i have this drop down box and an action is triggered upon onChange event..
when this is triggered it goes to a servlet and updates the content of the xml file depending on the chosen value in the drop down list..then directs it to the same page (jsp page containing the dropdown), basically reloading the page..

the problem is loadXML doesnt seem to behave consistently..
when the page is first viewed the xml is loaded correctly..but then as i try triggering the action by changing the selected value of the dropdown box, sometimes it doesnt load the content of the xml file and loads the same xml before the event was triggered..

i am reading the same xml file always, except i delete the xml file and writes a new one everytime the event is triggered..
i checked the xml file and it is correct, meaning the content that should be loaded is correct, i just dont get why it is not loaded through loadXML..

this doesnt happen always..but a lot of times, it happens whenever i trigger the event by changing the value in the drop down several times..

thank you..hope you can help me out..
Answer posted on Nov 23, 2007 05:55
Most probably issue can be caused by browser caching
You can try to call next function
    grid.preventIECaching(true);

( in latest version it must be called automatically, but you still can try to add it )
Command add unique elements to url, so each time it will be refreshed for sure, if it still not helps - please contact us directly at support@dhtmlx.com - I will provide you a version of grid which use POST instead of GET, which is never cached.
Answer posted by josephtan2k on Nov 25, 2007 22:07

i tried what you've suggested, using grid.preventIECaching(true);..

but still doesnt work..just to check where should this statement be placed?

before initialization?befor loadXML? after?onLoad of the body?

hope you can help me..thanks..

Answer posted by Stanislav on Nov 26, 2007 02:31
The statement need to be placed anywhere before loadXML command ( it is called once, but will affect all later server side calls )
In normal case statement must be enough, because it force unique urls for each call , which must not be cached by server ( which server do you use? can it be that server configured for strong caching ? )


if problem still occurs - please contact us directly at support@dhtmlx.com - I will provide you a version of grid which use POST instead of GET, which is never cached.

Answer posted by josephtan2k on Nov 28, 2007 16:08

hi..

ive received the version of grid which uses POST instead of GET (dhtmlxcommon.js), but still didnt work, i've also tried other approaches..

i made a button which does loadXML(), basically to reload the XML if it fails, it works..but i only made the button for testing purposes..so if there are any more help you can give, ill gladly appreciate..

thank you for being helpful..

Answer posted by Support on Nov 29, 2007 03:47