Index: core/src/com/icesoft/faces/webapp/command/UpdateElements.java =================================================================== --- core/src/com/icesoft/faces/webapp/command/UpdateElements.java (revision 74) +++ core/src/com/icesoft/faces/webapp/command/UpdateElements.java (working copy) @@ -14,6 +14,7 @@ public class UpdateElements extends AbstractCommand { private final static Pattern START_CDATA = Pattern.compile("<\\!\\[CDATA\\["); private final static Pattern END_CDATA = Pattern.compile("\\]\\]>"); + private final static String SCRIPT = "script"; private Element[] updates; public UpdateElements(Element[] updates) { @@ -31,6 +32,13 @@ for (int j = 0; j < updates.length; j++) { Element update = updates[j]; if (update.getAttribute("id").equals(previousUpdate.getAttribute("id"))) { + // For script nodes need to append new update to previous update + // rather than overwriting. Use '\n' newline separator as each + // script text element ends in a random comment string. + if (update.getNodeName().equals(SCRIPT)) { + update.getFirstChild().setTextContent(previousUpdate.getFirstChild().getTextContent() + + '\n' + update.getFirstChild().getTextContent()); + } overriden = true; break; } }