[richfaces-svn-commits] JBoss Rich Faces SVN: r2075 - trunk/ui/calendar/src/main/templates/org/richfaces.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Aug 6 10:18:59 EDT 2007


Author: akushunin
Date: 2007-08-06 10:18:59 -0400 (Mon, 06 Aug 2007)
New Revision: 2075

Modified:
   trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
added button "Reset" for readonly mode
added onclick attribute for input.

Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx	2007-08-06 13:44:50 UTC (rev 2074)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx	2007-08-06 14:18:59 UTC (rev 2075)
@@ -63,9 +63,11 @@
 				addPopupToAjaxRendered(context, component);
 				Boolean readonly = Boolean.FALSE;
 				String hidden = "text";
+				String onclick =null;
 				String inputType = component.getAttributes().get("inputType").toString();
 				if(inputType.equals("readonly")){
 					readonly=Boolean.TRUE;
+					onclick = "$(this.form.id+':calendar').component.doExpand();";
 				}
 				else{
 					if (inputType.equals("hidden")){
@@ -74,6 +76,7 @@
 				}
 				variables.setVariable("readonly",readonly);
 				variables.setVariable("hidden",hidden);
+				variables.setVariable("onclick",onclick);
 				]]>
 				
 		</jsp:scriptlet>
@@ -97,18 +100,34 @@
 				size="#{component.attributes['inputSize']}"
 				style="#{component.attributes['style']}"
 				tabindex="#{component.attributes['tabindex']}"
-				onclick="#{component.attributes['onclick']}">
+				onclick="#{onclick}">
 				 </input>
 		<button id="#{clientId}PopupButton"
 				accesskey="#{component.attributes['accesskey']}"
 	 			name="#{clientId}"
-	 			onclick="$(this.form.id+':calendar').component.doExpand();"
-	 			
+	 			onclick="$(this.form.id+':calendar').component.doExpand();"	 			
 				style="#{component.attributes['style']}"
 				tabindex="#{component.attributes['tabindex']}"
 				type="button">
 				#{component.attributes['buttonLabel']}
 		</button>
+		<jsp:scriptlet>
+		<![CDATA[        
+		         if(readonly.booleanValue()){ 
+		]]>
+		</jsp:scriptlet> 
+		<button 
+		id="#{clientId}ResetButton"
+		type="button"		
+		onclick="$(this.form.id+':calendar').component.resetSelectedDate();"
+		>	
+		Reset	
+		</button>
+		<jsp:scriptlet>
+		<![CDATA[        
+				} 
+		]]>
+		</jsp:scriptlet> 
 	</span>
 			<jsp:scriptlet>
 		<![CDATA[




More information about the richfaces-svn-commits mailing list