[richfaces-svn-commits] JBoss Rich Faces SVN: r6080 - in trunk/sandbox/samples/inplaceInput-sample/src/main: webapp/WEB-INF and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Feb 14 10:15:32 EST 2008


Author: abelevich
Date: 2008-02-14 10:15:32 -0500 (Thu, 14 Feb 2008)
New Revision: 6080

Modified:
   trunk/sandbox/samples/inplaceInput-sample/src/main/java/org/richfaces/samples/Bean.java
   trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/WEB-INF/faces-config.xml
   trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp
   trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml
Log:
extended demo app.

Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/java/org/richfaces/samples/Bean.java
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/java/org/richfaces/samples/Bean.java	2008-02-14 15:14:51 UTC (rev 6079)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/java/org/richfaces/samples/Bean.java	2008-02-14 15:15:32 UTC (rev 6080)
@@ -1,39 +1,204 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- */
-
 package org.richfaces.samples;
 
-
-/**
- * @author Vladimir Molotkov
- *
- */
 public class Bean {
-    public String value = "AAAAAAS";
 
-    public String getValue() {
-        return value;
-    }
+	private boolean showControls;
+	
+	private boolean applyFromControlsOnly;
+	
+	private boolean selectOnEdit;
+	
+	private String defaultLabel = "Click...";
+	
+	private String controlsPosition="right";
+	
+	private Integer inputMaxLength = 255;
+	
+	private String width;
+	
+	private String minInputWidth = "70px";
+	
+	private String maxInputWidth = "150px" ;
+	
+	private String controlsHorizontalAlign="left";
+	
+	private String value = "New York";
+	
+	private String editEvent = "click";
+	
+	private String oneditactivation;
+	
+	private String onviewactivation;
+	
+	private String oneditactivated;
+	
+	private String onviewactivated;
+		
+	private String saveControlIcon;
+	
+	private String cancelControlIcon;
+	
+	private String onchangeScript;
+	
+	private int tabindex;
 
-    public void setValue(String value) {
-        this.value = value;
-    }
-}
\ No newline at end of file
+	public String getDefaultLabel() {
+		return defaultLabel;
+	}
+
+	public void setDefaultLabel(String defaultLabel) {
+		this.defaultLabel = defaultLabel;
+	}
+
+	public String getWidth() {
+		return width;
+	}
+
+	public void setWidth(String width) {
+		this.width = width;
+	}
+
+	public String getMinInputWidth() {
+		return minInputWidth;
+	}
+
+	public void setMinInputWidth(String minInputWidth) {
+		this.minInputWidth = minInputWidth;
+	}
+
+	public String getMaxInputWidth() {
+		return maxInputWidth;
+	}
+
+	public void setMaxInputWidth(String maxInputWidth) {
+		this.maxInputWidth = maxInputWidth;
+	}
+
+	public String getControlsHorizontalAlign() {
+		return controlsHorizontalAlign;
+	}
+
+	public void setControlsHorizontalAlign(String controlsHorizontalAlign) {
+		this.controlsHorizontalAlign = controlsHorizontalAlign;
+	}
+
+	public String getEditEvent() {
+		return editEvent;
+	}
+
+	public void setEditEvent(String editEvent) {
+		this.editEvent = editEvent;
+	}
+
+	public boolean isShowControls() {
+		return showControls;
+	}
+
+	public void setShowControls(boolean showControls) {
+		this.showControls = showControls;
+	}
+
+	public String getSaveControlIcon() {
+		return saveControlIcon;
+	}
+
+	public void setSaveControlIcon(String saveControlIcon) {
+		this.saveControlIcon = saveControlIcon;
+	}
+
+	public String getCancelControlIcon() {
+		return cancelControlIcon;
+	}
+
+	public void setCancelControlIcon(String cancelControlIcon) {
+		this.cancelControlIcon = cancelControlIcon;
+	}
+
+	public boolean getSelectOnEdit() {
+		return selectOnEdit;
+	}
+
+	public void setSelectOnEdit(boolean selectOnEdit) {
+		this.selectOnEdit = selectOnEdit;
+	}
+
+	public int getTabindex() {
+		return tabindex;
+	}
+
+	public void setTabindex(int tabindex) {
+		this.tabindex = tabindex;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	public boolean isApplyFromControlsOnly() {
+		return applyFromControlsOnly;
+	}
+
+	public void setApplyFromControlsOnly(boolean applyFromControlsOnly) {
+		this.applyFromControlsOnly = applyFromControlsOnly;
+	}
+
+	public String getOneditactivation() {
+		return oneditactivation;
+	}
+
+	public void setOneditactivation(String oneditactivation) {
+		this.oneditactivation = oneditactivation;
+	}
+
+	public String getOnviewactivation() {
+		return onviewactivation;
+	}
+
+	public void setOnviewactivation(String onviewactivation) {
+		this.onviewactivation = onviewactivation;
+	}
+
+	public String getOneditactivated() {
+		return oneditactivated;
+	}
+
+	public void setOneditactivated(String oneditactivated) {
+		this.oneditactivated = oneditactivated;
+	}
+
+	public String getOnviewactivated() {
+		return onviewactivated;
+	}
+
+	public void setOnviewactivated(String onviewactivated) {
+		this.onviewactivated = onviewactivated;
+	}
+
+	public String getControlsPosition() {
+		return controlsPosition;
+	}
+
+	public void setControlsPosition(String controlsPosition) {
+		this.controlsPosition = controlsPosition;
+	}
+
+	public String getOnchangeScript() {
+		return onchangeScript;
+	}
+
+	public void setOnchangeScript(String onchangeScript) {
+		this.onchangeScript = onchangeScript;
+	}
+
+	public Integer getInputMaxLength() {
+		return inputMaxLength;
+	}
+
+	public void setInputMaxLength(Integer inputMaxLength) {
+		this.inputMaxLength = inputMaxLength;
+	}
+}

Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/WEB-INF/faces-config.xml	2008-02-14 15:14:51 UTC (rev 6079)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/WEB-INF/faces-config.xml	2008-02-14 15:15:32 UTC (rev 6080)
@@ -23,4 +23,10 @@
         <managed-bean-class>org.richfaces.SkinBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
     </managed-bean>
+  	<managed-bean>
+        <managed-bean-name>bean</managed-bean-name>
+        <managed-bean-class>org.richfaces.samples.Bean</managed-bean-class>
+        <managed-bean-scope>session</managed-bean-scope>
+    </managed-bean>
+    
 </faces-config>

Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp	2008-02-14 15:14:51 UTC (rev 6079)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp	2008-02-14 15:15:32 UTC (rev 6080)
@@ -16,16 +16,82 @@
 			</h:form>
 									
 			<h:form>
-														
-				<ii:inplaceInput value="Perec"
-					oneditactivation="alert('oneditactivation')"
-					onviewactivation="alert('onviewactivation')"
-					oneditactivated="alert('oneditactivated')"
-					onviewactivated="alert('onviewactivated')"
-					/>
-				<br/>
+			 	<h:panelGrid columns="2">
+			 		
+			 		<h:outputText value="showControls (default: false): " />
+					<h:selectBooleanCheckbox value="#{bean.showControls}"/>
+
+					<h:outputText value="applyFromControlsOnly (default: false): " />
+					<h:selectBooleanCheckbox value="#{bean.applyFromControlsOnly}" />
+					
+					<h:outputText value="selectOnEdit (default: false): " />
+					<h:selectBooleanCheckbox value="#{bean.selectOnEdit}" />
+					
+					<h:outputText value="defaultLabel is: " />
+					<h:inputText value="#{bean.defaultLabel}" />
+										
+					<h:outputText value="width (in 'px'): "/>
+					<h:inputText value="#{bean.width}" />
+					
+					<h:outputText value="minInputWidth (in 'px'): " />
+					<h:inputText value="#{bean.minInputWidth}" />
+					
+					<h:outputText value="maxInputWidth (in 'px'): " />
+					<h:inputText value="#{bean.maxInputWidth}" />
+					
+					<h:outputText value="controlsPosition (default: right) is: " />
+					<h:inputText value="#{bean.controlsPosition}" />
+					
+					<h:outputText value="controlsHorizontalAlign (default: left) is: " />
+					<h:inputText value="#{bean.onchangeScript}" />
+					
+					<h:outputText value="tabindex: " />
+					<h:inputText value="#{bean.tabindex}" />
+					
+					<h:outputText value="edit event script: " />
+					<h:inputText value="#{bean.editEvent}" />
+					
+					<h:outputText value="oneditactivation event script:" />
+					<h:inputText value="#{bean.oneditactivation}" />
+					
+					<h:outputText value="onviewactivation event script:" />
+					<h:inputText value="#{bean.onviewactivation}" />
+					
+					<h:outputText value="oneditactivated event script:" />
+					<h:inputText value="#{bean.oneditactivated}" />
+					
+					<h:outputText value="onviewactivated event script:" />
+					<h:inputText value="#{bean.onviewactivated}" />
+			 	</h:panelGrid>
+			 	
+			 		
+				<div style="width: 300px">	
+		       	Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
+					<ii:inplaceInput 
+					 	id="inplace"
+					 	value="#{bean.value}" 
+					 	selectOnEdit="#{bean.selectOnEdit}"
+					 	showControls="#{bean.showControls}"
+					 	applyFromControlsOnly="#{bean.applyFromControlsOnly}"
+					 	defaultLabel="#{bean.defaultLabel}"
+					 	width="#{bean.width}"
+					 	minInputWidth="#{bean.minInputWidth}"
+					 	maxInputWidth="#{bean.maxInputWidth}"
+					 	controlsPosition="#{bean.controlsPosition}"
+					 	controlsHorizontalAlign="#{bean.controlsHorizontalAlign}"
+					 	editEvent="#{bean.editEvent}"
+					 	oneditactivation="#{bean.oneditactivation}"
+					 	onviewactivation="#{bean.onviewactivation}"
+					 	oneditactivated="#{bean.oneditactivated}"
+					 	onviewactivated="#{bean.onviewactivated}"
+					 	saveControlIcon="#{bean.saveControlIcon}"
+					 	cancelControlIcon="#{bean.cancelControlIcon}"
+					 	tabindex="#{bean.tabindex}"					 	
+					>
+					</ii:inplaceInput>	
+					 Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+				</div>
 				<h:commandButton action="none" value="submit"></h:commandButton>
-				<br>
 			</h:form>
 		</f:view>
 	</body>	

Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml	2008-02-14 15:14:51 UTC (rev 6079)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml	2008-02-14 15:15:32 UTC (rev 6080)
@@ -19,22 +19,85 @@
 			</h:form>
 									
 			<h:form>
-				<br/>
-				<ii:inplaceInput id="component"
-					value="#{bean.value}"
-					selectOnEdit="true"
-					defaultLabel="Click..."
-					inputMaxWidth ="200px"
-					inputMinWidth ="100px"
-					showControls="true"
-					controlsPosition="right"
+			 	<h:panelGrid columns="2">
+			 		
+			 		<h:outputText value="showControls (default: false): " />
+					<h:selectBooleanCheckbox value="#{bean.showControls}"/>
+
+					<h:outputText value="applyFromControlsOnly (default: false): " />
+					<h:selectBooleanCheckbox value="#{bean.applyFromControlsOnly}" />
+					
+					<h:outputText value="selectOnEdit (default: false): " />
+					<h:selectBooleanCheckbox value="#{bean.selectOnEdit}" />
+					
+					<h:outputText value="defaultLabel is: " />
+					<h:inputText value="#{bean.defaultLabel}" />
+										
+					<h:outputText value="width (in 'px'): "/>
+					<h:inputText value="#{bean.width}" />
+					
+					<h:outputText value="minInputWidth (in 'px'): " />
+					<h:inputText value="#{bean.minInputWidth}" />
+					
+					<h:outputText value="maxInputWidth (in 'px'): " />
+					<h:inputText value="#{bean.maxInputWidth}" />
+					
+					<h:outputText value="inputMaxLength: " />
+					<h:inputText value="#{bean.inputMaxLength}" />
+					
+					<h:outputText value="controlsPosition (default: right) is: " />
+					<h:inputText value="#{bean.controlsPosition}" />
+					
+					<h:outputText value="controlsHorizontalAlign (default: left) is: " />
+					<h:inputText value="#{bean.onchangeScript}" />
+					
+					<h:outputText value="tabindex: " />
+					<h:inputText value="#{bean.tabindex}" />
+					
+					<h:outputText value="edit event script: " />
+					<h:inputText value="#{bean.editEvent}" />
+					
+					<h:outputText value="oneditactivation event script:" />
+					<h:inputText value="#{bean.oneditactivation}" />
+					
+					<h:outputText value="onviewactivation event script:" />
+					<h:inputText value="#{bean.onviewactivation}" />
+					
+					<h:outputText value="oneditactivated event script:" />
+					<h:inputText value="#{bean.oneditactivated}" />
+					
+					<h:outputText value="onviewactivated event script:" />
+					<h:inputText value="#{bean.onviewactivated}" />
+			 	</h:panelGrid>
+			 	
+			 		
+				<div style="width: 300px">	
+		       	Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
+					<ii:inplaceInput 
+					 	id="inplace"
+					 	value="#{bean.value}" 
+					 	selectOnEdit="#{bean.selectOnEdit}"
+					 	showControls="#{bean.showControls}"
+					 	applyFromControlsOnly="#{bean.applyFromControlsOnly}"
+					 	defaultLabel="#{bean.defaultLabel}"
+					 	width="#{bean.width}"
+					 	minInputWidth="#{bean.minInputWidth}"
+					 	maxInputWidth="#{bean.maxInputWidth}"
+					 	inputMaxLength="#{bean.inputMaxLength}"
+					 	controlsPosition="#{bean.controlsPosition}"
+					 	controlsHorizontalAlign="#{bean.controlsHorizontalAlign}"
+					 	editEvent="#{bean.editEvent}"
+					 	oneditactivation="#{bean.oneditactivation}"
+					 	onviewactivation="#{bean.onviewactivation}"
+					 	oneditactivated="#{bean.oneditactivated}"
+					 	onviewactivated="#{bean.onviewactivated}"
+					 	saveControlIcon="#{bean.saveControlIcon}"
+					 	cancelControlIcon="#{bean.cancelControlIcon}"
+					 	tabindex="#{bean.tabindex}"					 	
 					>
-					<f:facet name="controls">
-						<input type="button" name="test" value="ok" onclick="document.getElementById('j_id7:component').component.okHandler(event);"/>
-						<input type="button" name="test1" value="Cancel" onclick="document.getElementById('j_id7:component').component.cancelHandler(event);"/>
-					</f:facet>
 					</ii:inplaceInput>	
-				<br/>	
+					 Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+				</div>
 				<h:commandButton action="none" value="submit"></h:commandButton>
 			</h:form>
 		</f:view>




More information about the richfaces-svn-commits mailing list