Author: nbelaevski
Date: 2008-12-06 02:09:43 -0500 (Sat, 06 Dec 2008)
New Revision: 11601
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScriptResourceRenderer.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5216
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScriptResourceRenderer.java
===================================================================
---
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScriptResourceRenderer.java 2008-12-06
05:22:03 UTC (rev 11600)
+++
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScriptResourceRenderer.java 2008-12-06
07:09:43 UTC (rev 11601)
@@ -79,11 +79,11 @@
Map<String, Object> queues = (Map<String, Object>) data;
ResponseWriter writer = context.getResponseWriter();
- writer.writeText("with (A4J.AJAX) {", null);
+ writer.writeText("if (A4J) { if (A4J.AJAX) { with (A4J.AJAX) {", null);
for (Entry<String, Object> entry : queues.entrySet()) {
encodeQueue(writer, entry.getKey(), (QueueRendererData) entry.getValue());
}
- writer.writeText("};", null);
+ writer.writeText("}}};", null);
}
protected void doEncode(InternetResource resource, FacesContext context,
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java 2008-12-06
05:22:03 UTC (rev 11600)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java 2008-12-06
07:09:43 UTC (rev 11601)
@@ -84,7 +84,7 @@
DomText text = (DomText) list.get(0);
String scriptData = text.getData();
- return scriptData.replaceAll("^\\Qwith (A4J.AJAX) {\\E|\\Q};\\E$",
"");
+ return scriptData.replaceAll("^\\Qif (A4J) { if (A4J.AJAX) { with (A4J.AJAX)
{\\E|\\Q}}};\\E$", "");
}
private String[] splitScript(String s) {