Javascript not loaded the first time a new build runner is added

Hi,

This is related to my previous question (http://devnet.jetbrains.net/message/5475956).

I have a problem when adding a new build step; when the user selects my build runner, the page gets filled with my input boxes etc, but my javascript does not get loaded. This only happens the first time - refreshing the page causes the javascript to load properly, as it should. It also only happens when adding a new build step. Editing/viewing the runner is fine.

I've tried embedding the script directly in the page, using <bs:linkScript> and also a raw <script> tag, but all have the same behavior.

I can work around it by using a <c:set> variable, but it's pretty horrible, and I have to escape all the quotes in the script.

This seems like a bug whereby the selected build runner page layout gets loaded via ajax, but any included scripts in the new page section don't get parsed. Is this intentional? Forcing a page refresh would probably work, but goes against the idea of loading the runner settings section via ajax. Is there any other, better, solution that I might be able to use?



Cheers,
Justin
1 comment
Comment actions Permalink

Hi Justin,

Scripts included as <script src=... > in the body of the page are indeed not loaded on AJAX request and this seems to be a generic case not specific to TeamCity.

Your optinos here seems to be:
- put the script inline into .jsp and not in a separate .js file. This does not require usage of <c:set> tag as I understand.
- include your .js script all the time via adding an extension to append to page header and just use the JavaScript functions in the body of your .jsp

0

Please sign in to leave a comment.