Author: ilya_shaikovsky
Date: 2009-01-05 05:24:20 -0500 (Mon, 05 Jan 2009)
New Revision: 12091
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
Log:
markup corrected in order to remove flickering during updates. unnesessary reRendering
removed.
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 2009-01-05
10:18:50 UTC (rev 12090)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml 2009-01-05
10:24:20 UTC (rev 12091)
@@ -1,53 +1,64 @@
- <ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:rich="http://richfaces.org/rich">
- <style>
- .column{
- width:50%;
- vertical-align:top;
- }
- </style>
- <h:form>
- <h:panelGrid columns="2" width="100%"
columnClasses="column,column">
- <h:panelGroup style="height:320px;" layout="block">
- <rich:editor configuration="#{editorBean.currentConfiguration}"
id="editor" width="400" height="300" viewMode =
"#{editorBean.viewMode}" value="#{editorBean.value}">
- <a4j:support event="onchange" reRender="result"
ajaxSingle="true" requestDelay="1000"
rendered="#{editorBean.liveUpdatesEnabled}"/>
+
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <style>
+.column {
+ width: 400px;
+ vertical-align: top;
+}
+</style>
+ <h:form id="form">
+ <h:panelGrid columns="2" width="100%"
columnClasses="column,column">
+ <h:panelGroup style="height:320px;width:400px;"
layout="block">
+ <rich:editor configuration="#{editorBean.currentConfiguration}"
+ id="editor" width="400" height="300"
+ viewMode="#{editorBean.viewMode}"
value="#{editorBean.value}">
+ <a4j:support event="onchange" reRender="result"
ajaxSingle="true"
+ requestDelay="1000"
+ onsubmit="if (#{rich:element('form:editorvalue')}==null) return
false;" />
</rich:editor>
</h:panelGroup>
<rich:panel>
<f:facet name="header">
- <h:outputText value="Editor Settings"/>
+ <h:outputText value="Editor Settings" />
</f:facet>
<h:panelGrid columns="2">
- <h:outputText value="Select Editor Theme"/>
- <h:selectOneRadio value="#{editorBean.currentConfiguration}"
layout="pageDirection">
- <f:selectItems value="#{editorBean.configurations}"/>
- <a4j:support event="onclick" reRender="editor"/>
+ <h:outputText value="Select Editor Theme" />
+ <h:selectOneRadio value="#{editorBean.currentConfiguration}"
+ layout="pageDirection">
+ <f:selectItems value="#{editorBean.configurations}" />
+ <a4j:support event="onclick" reRender="editor"
requestDelay="500"
+ eventsQueue="settingsQueue" similarityGroupingId="settings"
/>
</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="onclick" reRender="editor"/>
+ <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="onclick" reRender="editor"
requestDelay="500"
+ eventsQueue="settingsQueue" similarityGroupingId="settings"
/>
</h:selectOneRadio>
<h:outputText value="Toggle Preview: " />
- <h:selectBooleanCheckbox value="#{editorBean.liveUpdatesEnabled}" >
- <a4j:support event="onclick" reRender="editor, result"/>
+ <h:selectBooleanCheckbox value="#{editorBean.liveUpdatesEnabled}">
+ <a4j:support event="onclick" reRender="result"
requestDelay="500"
+ eventsQueue="settingsQueue" similarityGroupingId="settings"
/>
</h:selectBooleanCheckbox>
</h:panelGrid>
</rich:panel>
<a4j:outputPanel layout="block" id="result">
<rich:panel rendered="#{editorBean.liveUpdatesEnabled}">
<f:facet name="header">
- <h:outputText value="Preview"/>
+ <h:outputText value="Preview" />
</f:facet>
- <h:outputText escape="false"
value="#{editorBean.value}"/>
+ <h:outputText escape="false" value="#{editorBean.value}"
+ id="editorvalue" />
</rich:panel>
</a4j:outputPanel>
- </h:panelGrid>
-
- </h:form>
- </ui:composition>
+ </h:panelGrid>
+
+ </h:form>
+</ui:composition>