[richfaces-svn-commits] JBoss Rich Faces SVN: r4553 - trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Dec 6 08:32:24 EST 2007


Author: abelevich
Date: 2007-12-06 08:32:24 -0500 (Thu, 06 Dec 2007)
New Revision: 4553

Modified:
   trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
Log:
add correctIdReference method (RF-1499)

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java	2007-12-06 13:31:15 UTC (rev 4552)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java	2007-12-06 13:32:24 UTC (rev 4553)
@@ -841,6 +841,25 @@
 		}
 		return target;
 	}
+	
+	/**
+	 * If target component contains generated id and for doesn't, correct for id 
+	 * @param forAttr
+	 * @param target
+	 * 
+	 */
+	public String correctForIdReference(String forAttr, UIComponent component) {
+		
+		int contains = forAttr.indexOf(UIViewRoot.UNIQUE_ID_PREFIX);
+		if (contains <= 0) {
+			String id = component.getId();
+			int pos = id.indexOf(UIViewRoot.UNIQUE_ID_PREFIX); 
+			if ( pos > 0) {
+				forAttr = forAttr.concat(id.substring(pos));
+			}
+		}
+		return forAttr;
+	}
 
 	private UIComponent findUIComponentBelow(UIComponent root, String id) {
 		UIComponent target = null;




More information about the richfaces-svn-commits mailing list