PDA

View Full Version : UpdateManager.update() duplicates header content



thejoker101
29 Mar 2007, 11:27 AM
It seems that if you load content with UpdateManager.update() and loadScripts set to true that the <script /> and <link /> tags will get appended again in the header on subsequent calls. Shouldn't it over write them or check if they already exist?

JeffHowden
29 Mar 2007, 11:29 AM
No, it shouldn't. As the developer, you should make sure they're not included in the response. ;)

Draven
29 Mar 2007, 12:21 PM
No, it shouldn't. As the developer, you should make sure they're not included in the response. ;)

That doesn't make any sense. If the scripts are included in a page being included using the update() function and the update function is appending them to the main page header over and over, how is that the dev's problem? It's the Library that's doing it, not the dev. I can't see how the dev should have to write a bunch of convaluted code to check if the updated div has been updated once then have the code in the included page exclude it's internal <script src='...'> tag. Do you?

I have this issue where a grid in a page being included using update() is reapllying it's internal CSS styles to the header of the main page each time the update is called. and I'm not even creating these styles, I assume the grid class is doing it. When I look in firebug, the css styles don't even contain anything, they're just empty names.



<style type="text/css">
1#orgprop .x-grid-col-oidPropertyClient {
2}
3#orgprop .x-grid-td-oidPropertyClient {
4}
5#orgprop .x-grid-hd-oidPropertyClient {
6}
7#orgprop .x-grid-split-oidPropertyClient {
8}
9#orgprop .x-grid-col-propertyName {
10}
11#orgprop .x-grid-td-propertyName {
12}
13#orgprop .x-grid-hd-propertyName {
14}
15#orgprop .x-grid-split-propertyName {
16}
17#orgprop .x-grid-col-state {
18}
19#orgprop .x-grid-td-state {
20}
21#orgprop .x-grid-hd-state {
22}
23#orgprop .x-grid-split-state {
24}
25#orgprop .x-grid-col-countryCode {
26}
27#orgprop .x-grid-td-countryCode {
28}
29#orgprop .x-grid-hd-countryCode {
30}
31#orgprop .x-grid-split-countryCode {
32}
33
</style>


that repeats everytime I reissue the update().

JeffHowden
29 Mar 2007, 12:39 PM
No, it shouldn't. As the developer, you should make sure they're not included in the response. ;)

That doesn't make any sense. If the scripts are included in a page being included using the update() function and the update function is appending them to the main page header over and over, how is that the dev's problem? It's the Library that's doing it, not the dev. I can't see how the dev should have to write a bunch of convaluted code to check if the updated div has been updated once then have the code in the included page exclude it's internal <script src='...'> tag. Do you?

It's the dev's problem because the dev keeps sending them down the pipe with every response when he knows they're already included in the header by the calling document (or should be if they're going to be needed by multiple apps. The reality is that I don't think there's even a way for the update() method to compare the scripts and stylesheets in the response against ones already included in the header. Even if there were, should it really incur the performance hit to do that each time when the developer could simply not include them in the response?


I have this issue where a grid in a page being included using update() is reapllying it's internal CSS styles to the header of the main page each time the update is called. and I'm not even creating these styles, I assume the grid class is doing it. When I look in firebug, the css styles don't even contain anything, they're just empty names.

That's part of the Grid class I'd imagine as it builds its own CSS rules to govern the styling. In that case, it probably should check the existing CSS rules to see if it needs to regenerate them or simply update existing ones, as necessary.