[richfaces-svn-commits] JBoss Rich Faces SVN: r11533 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Dec 3 13:38:11 EST 2008


Author: ilya_shaikovsky
Date: 2008-12-03 13:38:11 -0500 (Wed, 03 Dec 2008)
New Revision: 11533

Modified:
   trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
Log:
reopened https://jira.jboss.org/jira/browse/RF-5195 



Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml	2008-12-03 18:37:51 UTC (rev 11532)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml	2008-12-03 18:38:11 UTC (rev 11533)
@@ -11,9 +11,9 @@
 			}
 		</style>
 		<h:form>
-			<a4j:jsFunction name="submit" reRender="result"/>
 			<h:panelGrid columns="2" width="100%" columnClasses="column,column">
-			<rich:editor configuration="#{editorBean.currentConfiguration}" id="editor" width="400" viewMode = "#{editorBean.viewMode}" value="#{editorBean.value}" onchange="submit">
+			<rich:editor configuration="#{editorBean.currentConfiguration}" id="editor" width="400" viewMode = "#{editorBean.viewMode}" value="#{editorBean.value}">
+				<a4j:support event="onchange" reRender="result" ajaxSingle="true" requestDelay="1000" rendered="#{editorBean.liveUpdatesEnabled}"/>
 			</rich:editor>
 			
 			<rich:panel>
@@ -24,24 +24,30 @@
 					<h:outputText value="Select Editor Theme"/>
 					<h:selectOneRadio value="#{editorBean.currentConfiguration}" layout="pageDirection">
 						<f:selectItems value="#{editorBean.configurations}"/>
-						<a4j:support event="onchange" reRender="editor" />
+						<a4j:support event="onchange" reRender="editor"/>
 					</h:selectOneRadio>
 					<h:outputText value="Toggle Modes"/>
 					<h:selectOneRadio value="#{editorBean.viewMode}" layout="pageDirection">
 						<f:selectItem itemLabel="WYSIWYG mode" itemValue="visual"/>
 						<f:selectItem itemLabel="Simple Text Area" itemValue="source"/>
-						<a4j:support event="onchange" reRender="editor" />
+						<a4j:support event="onchange" reRender="editor"/>
 					</h:selectOneRadio>
+					<h:outputText value="Toggle Preview: " />
+					<h:selectBooleanCheckbox value="#{editorBean.liveUpdatesEnabled}" >
+						<a4j:support event="onchange" reRender="editor, result"/>
+					</h:selectBooleanCheckbox>
 				</h:panelGrid>
 			</rich:panel>
 			</h:panelGrid>
 			
-			<rich:panel id="result">
-				<f:facet name="header">
-					<h:outputText value="Preview"/>
-				</f:facet>
-				<h:outputText escape="false" value="#{editorBean.value}"/>
-			</rich:panel>
+			<a4j:outputPanel layout="block" id="result">
+				<rich:panel rendered="#{editorBean.liveUpdatesEnabled}">
+					<f:facet name="header">
+						<h:outputText value="Preview"/>
+					</f:facet>
+					<h:outputText escape="false" value="#{editorBean.value}"/>
+				</rich:panel>
+			</a4j:outputPanel>
 			
 		</h:form>
 	</ui:composition>




More information about the richfaces-svn-commits mailing list