From 688d3f7f4e71c9a3d311af7b56cd39bba215910f Mon Sep 17 00:00:00 2001 From: Jeremy Grelle Date: Mon, 3 Aug 2009 22:05:12 +0000 Subject: [PATCH] SWF-1115 - Id handling of Spring AjaxViewRoot causes problems to RichFaces AjaxViewRoot --- .../org/springframework/faces/ui/AjaxViewRoot.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/AjaxViewRoot.java b/spring-faces/src/main/java/org/springframework/faces/ui/AjaxViewRoot.java index 9be912df..9be0777d 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/AjaxViewRoot.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/AjaxViewRoot.java @@ -49,6 +49,7 @@ import org.springframework.webflow.execution.View; *

* * @author Jeremy Grelle + * @author Nazaret Kazarian */ public class AjaxViewRoot extends DelegatingViewRoot { @@ -73,13 +74,18 @@ public class AjaxViewRoot extends DelegatingViewRoot { public AjaxViewRoot(UIViewRoot original) { super(original); renderIdsExpr = FacesContext.getCurrentInstance().getApplication().createValueBinding(RENDER_IDS_EXPRESSION); - original.setId(createUniqueId()); + if (!StringUtils.hasText(original.getId())) { + original.setId(createUniqueId()); + } swapChildren(original, this); - setId(original.getId() + "_ajax"); } // implementing view root + public String getId() { + return getOriginalViewRoot().getId() + "_ajax"; + } + public void queueEvent(FacesEvent event) { Assert.notNull(event, "Cannot queue a null event."); events.add(event);