[ajax4jsf-svn-commits] JBoss Ajax4JSF SVN: r82 - trunk/cdk/generator/src/main/resources/META-INF/templates12.

ajax4jsf-svn-commits at lists.jboss.org ajax4jsf-svn-commits at lists.jboss.org
Fri Apr 13 14:57:37 EDT 2007


Author: dbiatenia
Date: 2007-04-13 14:57:37 -0400 (Fri, 13 Apr 2007)
New Revision: 82

Modified:
   trunk/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm
   trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm
Log:


Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm	2007-04-12 19:04:29 UTC (rev 81)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm	2007-04-13 18:57:37 UTC (rev 82)
@@ -81,8 +81,12 @@
 		
 		component.setId("component");
 #foreach( $prop in $component.properties )
-	#if(!$prop.exist)
-		component.${prop.setterName}( " __$prop.name" );
+	#if(!$prop.exist && $prop.name != "value")
+		#if($prop.classname == "java.lang.String")
+		component.${prop.setterName}( " __$prop.name" );	
+		#elseif($prop.classname == "java.lang.Boolean")
+		component.${prop.setterName}( new Boolean(true) );
+		#end
 	 #end
 #end
 		

Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm	2007-04-12 19:04:29 UTC (rev 81)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm	2007-04-13 18:57:37 UTC (rev 82)
@@ -10,7 +10,8 @@
 import javax.faces.component.UIComponent;
 import javax.faces.webapp.UIComponentTag;
 import ${component.classname};
-
+import javax.faces.application.Application;
+import javax.faces.el.ValueBinding;
 import javax.servlet.Servlet;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
@@ -85,11 +86,24 @@
 	
 	public void testSetPropertiesUIComponent() {
 		${component.simpleClassName} component = new ${component.simpleClassName}();
-/*
+	// create binding		
+		Application application = null;
+		ValueBinding binding = null;
+
 	#foreach( $prop in $tag.properties )
-		tag.${prop.setterName}("__${prop.name}");
+		#if($prop.el)
+			 application = facesContext.getApplication();
+		     binding = application.createValueBinding(component.getOnclick());
+    		 component.setValueBinding("${prop.name}", binding);
+				#if($prop.classname == "java.lang.String")
+				component.${prop.setterName}( " __$prop.name" );	
+				#elseif($prop.classname == "java.lang.Boolean")
+				component.${prop.setterName}( new Boolean(true) );
+				#end
+		#end
+		//tag.${prop.setterName}("__${prop.name}");
 	#end
-*/
+
 		tag.setProperties(component);
 
 /*




More information about the ajax4jsf-svn-commits mailing list