Author: artdaw
Date: 2008-07-28 07:21:37 -0400 (Mon, 28 Jul 2008)
New Revision: 9801
Modified:
trunk/docs/userguide/en/src/main/docbook/included/hotKey.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/hotKey.xml
Log:
https://jira.jboss.org/jira/browse/RF-3783 - Key Feature, JavaScript API example were
added
Modified: trunk/docs/userguide/en/src/main/docbook/included/hotKey.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/hotKey.desc.xml 2008-07-28 09:57:18
UTC (rev 9800)
+++ trunk/docs/userguide/en/src/main/docbook/included/hotKey.desc.xml 2008-07-28 11:21:37
UTC (rev 9801)
@@ -18,6 +18,11 @@
<itemizedlist>
<listitem>
<para>
+ Includes all features of the <ulink
url="http://code.google.com/p/js-hotkeys/">Javascript jQuery Hotkeys
Plugin</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
Hot key registration by request through JavaScript API
</para>
</listitem>
Modified: trunk/docs/userguide/en/src/main/docbook/included/hotKey.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/hotKey.xml 2008-07-28 09:57:18 UTC
(rev 9800)
+++ trunk/docs/userguide/en/src/main/docbook/included/hotKey.xml 2008-07-28 11:21:37 UTC
(rev 9801)
@@ -69,7 +69,8 @@
<itemizedlist>
<listitem>
<para>
- by attaching it to the whole page (<property>html[0]
element</property>). This is default scenario.
+ the easiest way is not to register it at all. In this case the <emphasis
role="bold"><property><rich:hotKey></property></emphasis>
+ component is attached to the whole page (<property>html[0]
element</property>). This is default scenario.
</para>
</listitem>
<listitem>
@@ -130,7 +131,7 @@
<itemizedlist>
<listitem>
<para>
- "immediate" - the component is rendered in browser
immediately
+ "immediate" - the component is rendered in browser
immediately (by default)
</para>
</listitem>
<listitem>
@@ -155,6 +156,24 @@
<para>
The
<emphasis><property>"checkParent"</property></emphasis>
attribute defines the hotkey handling of events generated by child components nested into
the parent component to which the <emphasis
role="bold"><property><rich:hotKey></property></emphasis>
is attached.
</para>
+ <para>
+ The <emphasis
role="bold"><property><rich:hotKey></property></emphasis>
component also provides a number of JavaScript API functions. There is an example below.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:form id="myForm">
+ <rich:hotKey id="myKey" key="ctrl+g"
handler="alert('Ctrl+G is pressed')" />
+ <button onclick="${rich:component('myKey')}.enable(); return
false;">Turn Ctrl+G On</button>
+ <button onclick="${rich:component('myKey')}.disable(); return
false;">Turn Ctrl+G Off</button>
+</h:form>
+...]]></programlisting>
+ <para>
+ In the example above the <property>Ctrl+G</property> is registered as a
global hotkey,
+ so if you press this key combination the alert window with the
<property>"Ctrl+G is pressed"</property> text appears. With
the help
+ of <property>enable()</property>,
<property>disable()</property> JavaScript API fucntions you could enable or
disable registered hotkey.
+ </para>
</section>
<section>
<title>JavaScript API</title>
@@ -169,10 +188,12 @@
</thead>
<tbody>
<row>
- <entry>add(selector, key, handler)</entry>
<entry>
- Adds the hotkey(from key param) for elements targeted by selector. Assigns handler
function to the key.
- </entry>
+ add(selector, key, handler)
+ </entry>
+ <entry>
+ Adds the hotkey(from key param) for elements targeted by selector. Assigns handler
function to the key
+ </entry>
</row>
<row>
<entry>remove()</entry>