You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/11/26 20:36:22 UTC
svn commit: r1039531 - in
/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main:
conf/META-INF/facelets-taglib-base.xml
java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java
Author: lu4242
Date: Fri Nov 26 19:36:22 2010
New Revision: 1039531
URL: http://svn.apache.org/viewvc?rev=1039531&view=rev
Log:
MFCOMMONS-17 Add facelet function findComponent (add findComponentFrom)
Modified:
myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/conf/META-INF/facelets-taglib-base.xml
myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/conf/META-INF/facelets-taglib-base.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/conf/META-INF/facelets-taglib-base.xml?rev=1039531&r1=1039530&r2=1039531&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/conf/META-INF/facelets-taglib-base.xml (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/conf/META-INF/facelets-taglib-base.xml Fri Nov 26 19:36:22 2010
@@ -27,6 +27,12 @@
<function-class>org.apache.myfaces.commons.facelets.util.FaceletsFunctionLibrary</function-class>
<function-signature>javax.faces.component.UIComponent findComponent(java.lang.String)</function-signature>
</function>
+
+ <function>
+ <function-name>findComponentFrom</function-name>
+ <function-class>org.apache.myfaces.commons.facelets.util.FaceletsFunctionLibrary</function-class>
+ <function-signature>javax.faces.component.UIComponent findComponentFrom(javax.faces.component.UIComponent, java.lang.String)</function-signature>
+ </function>
<function>
<function-name>outputClientId</function-name>
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java?rev=1039531&r1=1039530&r2=1039531&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java Fri Nov 26 19:36:22 2010
@@ -40,4 +40,13 @@ public final class FaceletsFunctionLibra
FacesContext ctx = FacesContext.getCurrentInstance();
return ctx.getViewRoot().findComponent(expr).getClientId(ctx);
}
+
+ public static UIComponent findComponentFrom(UIComponent c, String expr)
+ {
+ if (c != null)
+ {
+ return c.findComponent(expr);
+ }
+ return null;
+ }
}