[richfaces-svn-commits] JBoss Rich Faces SVN: r2402 - in trunk: samples/calendar-sample/src/main/webapp/pages and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Aug 22 10:24:21 EDT 2007


Author: akushunin
Date: 2007-08-22 10:24:21 -0400 (Wed, 22 Aug 2007)
New Revision: 2402

Modified:
   trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
   trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
   trunk/ui/calendar/src/main/config/component/calendar.xml
   trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Rf-650
Rf-659
Updated calendar-demo application.

Modified: trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
--- trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java	2007-08-22 14:19:52 UTC (rev 2401)
+++ trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java	2007-08-22 14:24:21 UTC (rev 2402)
@@ -42,12 +42,13 @@
 
 	private boolean popup;
 	private boolean readonly;
+	private boolean showInput;
+	private boolean enableManualInput;	
 	private String pattern;
 	private Date currentDate;
 	private Date selectedDate;
 	private String jointPoint;
 	private String direction;
-	private String inputType;
 	private String boundary;
 
 	private boolean useCustomDayLabels;
@@ -84,18 +85,28 @@
 		jointPoint = "bottom-left";
 		direction = "bottom-right";
 		readonly = true;
-		inputType = "readonly";
+		enableManualInput=false;
+		showInput=true;
 		boundary = "inactive";
 	}
+	
+	
+	public boolean isShowInput() {
+		return showInput;
+	}
 
-	public String getInputType() {
-		return inputType;
+	public void setShowInput(boolean showInput) {
+		this.showInput = showInput;
 	}
 
-	public void setInputType(String inputType) {
-		this.inputType = inputType;
+	public boolean isEnableManualInput() {
+		return enableManualInput;
 	}
 
+	public void setEnableManualInput(boolean enableManualInput) {
+		this.enableManualInput = enableManualInput;
+	}
+
 	public boolean isReadonly() {
 		return readonly;
 	}

Modified: trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp	2007-08-22 14:19:52 UTC (rev 2401)
+++ trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp	2007-08-22 14:24:21 UTC (rev 2402)
@@ -45,7 +45,8 @@
 					jointPoint="#{calendarBean.jointPoint}"
 					direction="#{calendarBean.direction}"
 					buttonLabel="PopUp"					
-					inputType="#{calendarBean.inputType}"
+					enableManualInput="#{calendarBean.enableManualInput}"
+					showInput="#{calendarBean.showInput}"
 					boundaryDatesMode="#{calendarBean.boundary}">
 					<f:facet name="optionalHeader">
 						<h:outputText value="optionalHeader Facet" />
@@ -100,18 +101,20 @@
 						<f:selectItem itemLabel="top-left" itemValue="top-left"/>
 						<f:selectItem itemLabel="auto" itemValue="auto"/>
 					</h:selectOneRadio>
-					<h:outputText value="InputType:" />
-					<h:selectOneRadio onchange="submit()" value="#{calendarBean.inputType}">
-						<f:selectItem itemLabel="readonly" itemValue="readonly"/>
-						<f:selectItem itemLabel="hidden" itemValue="hidden"/>
-						<f:selectItem itemLabel="editable" itemValue="editable"/>						
-					</h:selectOneRadio>
 					<h:outputText value="BoundaryDatesMode:" />
 					<h:selectOneRadio onclick="submit()" value="#{calendarBean.boundary}">
 						<f:selectItem itemLabel="inactive" itemValue="inactive"/>
 						<f:selectItem itemLabel="select" itemValue="select"/>
 						<f:selectItem itemLabel="scroll" itemValue="scroll"/>						
 					</h:selectOneRadio>
+					<h:outputText value="EnableManualInput:"></h:outputText>
+					<h:selectBooleanCheckbox value="#{calendarBean.enableManualInput}"
+						onclick="submit()">
+					</h:selectBooleanCheckbox>
+					<h:outputText value="ShowInput:"></h:outputText>
+					<h:selectBooleanCheckbox value="#{calendarBean.showInput}"
+						onclick="submit()">
+					</h:selectBooleanCheckbox>
 								
 		
 

Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml	2007-08-22 14:19:52 UTC (rev 2401)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml	2007-08-22 14:24:21 UTC (rev 2402)
@@ -159,17 +159,24 @@
 			<defaultvalue>"batch"</defaultvalue>
 		</property>
 		<property>
-			<name>inputType</name>
-			<classname>java.lang.String</classname>
-			<description></description>
-			<defaultvalue>"readonly"</defaultvalue>
-		</property>
-		<property>
 			<name>boundaryDatesMode</name>
 			<classname>java.lang.String</classname>
 			<description></description>
 			<defaultvalue>"inactive"</defaultvalue>
 		</property>
+		<property>
+	    	<name> enableManualInput </name>
+	    	<classname>boolean</classname>
+	    	<description>False value for this attribute makes a text field "read-only", so the value can be
+	    	changed only from a handle</description>
+	    	<defaultvalue>false</defaultvalue>
+	    </property>
+    	<property>
+	    	<name> showInput  </name>
+	    	<classname>boolean</classname>
+	    	<description>False value for this attribute makes text a field invisible</description>
+	    	<defaultvalue>true</defaultvalue>
+	    </property>
 				
 		
 	</component>

Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx	2007-08-22 14:19:52 UTC (rev 2401)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx	2007-08-22 14:24:21 UTC (rev 2402)
@@ -88,34 +88,35 @@
 				boolean popup = getUtils().isBooleanAttribute(component, "popup");
 				if (popup) {
 				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;
+								
+				boolean showInput = getUtils().isBooleanAttribute(component, "showInput");
+				boolean manualInput = getUtils().isBooleanAttribute(component, "enableManualInput");
+			    String onclick =null;
+			    String type="text";
+				if(manualInput){							
+					variables.setVariable("manualInput",new Boolean(!manualInput));
+				}
+				else{ 
+					variables.setVariable("manualInput",new Boolean(!manualInput));
 					onclick = "$('"+clientId+"').component.doExpand();";
+					}
+				if (!showInput){
+					type="hidden";
 				}
-				else{
-					if (inputType.equals("hidden")){
-						hidden = inputType;						
-					}				
-				}
-				variables.setVariable("readonly",readonly);
-				variables.setVariable("hidden",hidden);
+				
 				variables.setVariable("onclick",onclick);
+				variables.setVariable("type",type);
 				]]>
 				
 		</jsp:scriptlet>
 		<f:resource	name="org.richfaces.renderkit.html.iconimages.CalendarIcon" var="icon" />
 			<span id="#{clientId}Popup" >
 			<input 
-				x:passThruWithExclusions="name"
 				id="#{clientId}InputDate"
 				name="#{clientId}InputDate"
 				value="#{this:getInputValue(context,component)}" 
-				type="#{hidden}"
-				readonly="#{readonly}"
+				type="#{type}"
+				readonly="#{manualInput}"
 				disabled="#{component.attributes['disabled']}"
 				accesskey="#{component.attributes['accesskey']}"
 				maxlength="#{component.attributes['maxlength']}"




More information about the richfaces-svn-commits mailing list