Author: jjamrich
Date: 2011-11-09 09:40:52 -0500 (Wed, 09 Nov 2011)
New Revision: 22915
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richEditor/simple.xhtml
Log:
RFPL-1796: fix @ondirty and add button editor's JS API testing
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richEditor/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richEditor/simple.xhtml 2011-11-09
14:40:44 UTC (rev 22914)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richEditor/simple.xhtml 2011-11-09
14:40:52 UTC (rev 22915)
@@ -45,7 +45,7 @@
immediate="#{richEditorBean.attributes['immediate'].value}"
lang="#{richEditorBean.attributes['lang'].value}"
onblur="#{richEditorBean.attributes['onblur'].value}"
- ondirty="document.title = parseInt(document.title) +
1"
+
ondirty="#{richEditorBean.attributes['ondirty'].value}"
onchange="#{richEditorBean.attributes['onchange'].value}"
onfocus="#{richEditorBean.attributes['onfocus'].value}"
oninit="#{richEditorBean.attributes['oninit'].value}"
@@ -91,6 +91,39 @@
<br/><br/>
Your text: <h:outputText id="output"
value="#{richEditorBean.attributes['value'].value}"/>
+ <br/><br/>
+ <fieldset>
+ <legend>JavaScript API of rich:editor by
h:commandButton</legend>
+
+ <h:commandButton id="setReadOnly"
value="setReadonly()">
+ <rich:componentControl event="click"
operation="setReadonly" target="editor" />
+ </h:commandButton>
+
+ <h:commandButton id="setValue"
value="setValue()">
+ <rich:componentControl event="click"
operation="setVallue" target="editor" >
+ <f:param value="NEW EDITOR VALUE SET BY EDITOR JS
API!" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ </fieldset>
+
+ <br/>
+ <fieldset>
+ <legend>JavaScript API of rich:editor by
a4j:commandButton</legend>
+
+ <a4j:commandButton value="getValue()"
onclick="alert('Editor value:
'+#{rich:component('editor')}.getValue());" />
+ <a4j:commandButton value="setValue()"
onclick="#{rich:component('editor')}.setValue('NEW VALUE SET BY
JS!')" />
+ <a4j:commandButton value="getInput()"
onclick="alert('Inut value:
'+#{rich:component('editor')}.getInput());" />
+ <a4j:commandButton value="focus()"
onclick="#{rich:component('editor')}.focus()" />
+ <a4j:commandButton value="blur()"
onclick="#{rich:component('editor')}.blur()" />
+ <a4j:commandButton value="isFocused()"
onclick="alert('Is editor focused:
'+#{rich:component('editor')}.isFocused());" />
+ <a4j:commandButton value="isDirty()"
onclick="alert('Is editor dirty:
'+#{rich:component('editor')}.isDirty());" />
+ <a4j:commandButton value="isValueChanged()"
onclick="alert('Is editor value changed:
'+#{rich:component('editor')}.isValueChanged());" />
+ <a4j:commandButton value="isReadonly()"
onclick="alert('Is editor readonly:
'+#{rich:component('editor')}.isReadonly());" />
+ <a4j:commandButton value="setReadonly()"
onclick="#{rich:component('editor')}.setReadonly()" />
+
+ </fieldset>
+
</ui:define>
<ui:define name="outOfTemplateAfter">