Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Micha Hastrich on Dec 09, 2009 06:17
open dhtmlx forum
dhtmlXWindows seems to cache

Hi,

I'm trying to use dhtmlXWindows the following way:

* Generate Layout, etc (probably not interesting, is only the code around)
* Add Toolbar to Layout
* Generate DIV dynamically in JSP
* Generate Button in Toolbar which opens the dhtmlXWindow
* attach dynamically generated DIV to dhtmlXWindow

DIV i attach looks like this:

________________________________________________________________________________________________________

<div id="themeInhalt" style="font-family: Tahoma; font-size: 10px; width: 100%; height: 100%; overflow: auto;">
<table BORDER="0" CELLPADDING="2" CELLSPACING="2" align=center>
<tr>
<td align=middle colspan=3><b>Theme Einstellungen:<br /><br /><br /></b></td>
</tr>

<tr>
<td>Thema:</td>

<td><select name="Theme" id="Theme" size="1">
<option value="finance_orange">Finance Orange</option>
<option value="financered">Finance Red</option>
<option value="finance_orange_grau">Finance Orange Grey</option>
<option value="retro">Retro</option>
<option value="crystal">Kristall</option>
<option value="financeold">Finance Classic</option>
<option selected value="blueEnhanced">Blau - neu</option>
<option value="blue">Blau</option>

<option value="blueSM">Blau Theme von SM</option>
<option value="financeblue">Finance Blue</option>
<option value="finance">Finance</option>
<option value="classic">Klassisch</option>
<option value="fimox">Fimox</option>

</select></td>
<td></td>
</tr>

<tr>
<td>Icon-Größe:</td>

<td><select name="IconSize" id="IconSize" size="1">
<option selected value="s">klein</option>
<option value="l">groß</option>
<option value="m">mittel</option>

</select></td>
<td></td>
</tr>


<tr>
<td align=middle colspan=3><input type="button" name="changeTheme" value="Speichern"
onclick="changeTheme(document.getElementById('Theme').value, document.getElementById('IconSize').value)"></td>
</tr>


</table>
</div>

________________________________________________________________________________________________________

When i open the dhtmlXWindow the first time everything looks good.
Especially the "selected" attribute works - so i get the correct value in my DropDown Box.

But if i open the Window the second time it ignores the selected attribute and shows the last change made in the window.
It probably caches the last state and doesn't reload from the html coding.
Even if i reload the whole site.

I tried to destroy and unload everything, but still the caching problem exists.
Coding here:

var dhxWins = new dhtmlXWindows();
            dhxWins.enableAutoViewport(true);
            dhxWins.setImagePath("<%= dhtmlxPath %>/imgs/");
         themeWindow = dhxWins.createWindow("themeWindow", 400, 250, 400, 200);
         themeWindow.center();
     themeWindow.attachObject('themeInhalt');
     themeWindow.button("close").attachEvent("onClick", function() {
         themeWindow.detachObject('themeInhalt');
themeWindow.close();
dhxWins.unload();
});

Even with this many tries to unload the state it still caches and ignores the real content of the div (generated again on page reload with the same initial values as the first time)

What is going wrong here?
Answer posted by Alex (support) on Dec 09, 2009 06:46

Hello,

the issue wasn't reproduced locally. The sample is attached 

Attachments (1)
win_obj.zip41.64 Kb