Author: nbelaevski
Date: 2008-06-12 18:32:22 -0400 (Thu, 12 Jun 2008)
New Revision: 9023
Modified:
trunk/sandbox/samples/hotKey-sample/pom.xml
trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp
Log:
Latest updates for rich:hotKey
Modified: trunk/sandbox/samples/hotKey-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/hotKey-sample/pom.xml 2008-06-12 16:19:06 UTC (rev 9022)
+++ trunk/sandbox/samples/hotKey-sample/pom.xml 2008-06-12 22:32:22 UTC (rev 9023)
@@ -30,14 +30,9 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui</artifactId>
- <version>3.2.2-SNAPSHOT</version>
- </dependency>
- <dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>hotKey</artifactId>
- <version>3.2.2-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/Bean.java 2008-06-12
16:19:06 UTC (rev 9022)
+++ trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/Bean.java 2008-06-12
22:32:22 UTC (rev 9023)
@@ -25,5 +25,15 @@
*
*/
public class Bean {
+ private boolean rendered = true;
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
}
\ No newline at end of file
Modified: trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/web.xml 2008-06-12
16:19:06 UTC (rev 9022)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/web.xml 2008-06-12
22:32:22 UTC (rev 9023)
@@ -10,6 +10,10 @@
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
<!--
-->
<filter>
Modified: trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp 2008-06-12
16:19:06 UTC (rev 9022)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp 2008-06-12
22:32:22 UTC (rev 9023)
@@ -1,5 +1,7 @@
<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+
<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/ui/hotKey"
prefix="sb"%>
<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/functions"
prefix="rich" %>
<html>
@@ -8,16 +10,32 @@
</head>
<body>
<f:view>
- Alt+A and Alt+L are turned on when page is loaded<br/>
- <sb:hotKey id="me" key="alt+a" timing="immediate"
handler="alert('alt+A is pressed')" />
- <sb:hotKey id="you" key="alt+l" timing="immediate"
handler="alert('alt+L is pressed')" />
-
-
- <button onclick="${rich:component('me')}.invoke()">Turn Alt-A
On</button>
- <button onclick="${rich:component('me')}.remove()">Turn Alt-A
Off</button>
- <button onclick="${rich:component('you')}.invoke()">Turn Alt-L
On</button>
- <button onclick="${rich:component('you')}.remove()">Turn Alt-L
Off</button>
-
+ <h:form>
+ <h:panelGroup id="panel">
+ <h:panelGroup rendered="#{bean.rendered}">
+ Alt+A and Alt+L are turned on when page is loaded<br/>
+ Set focus to 'target' button and press Alt+T<br />
+
+ <sb:hotKey id="me" key="alt+a" timing="immediate"
handler="alert('alt+A is pressed')" />
+ <sb:hotKey id="you" key="alt+l" timing="onload"
handler="alert('alt+L is pressed')" />
+ <sb:hotKey id="targetted" key="alt+t"
timing="onload" handler="alert('alt+T is pressed')"
checkParent="false"
+ target="#targetButton" />
+
+ <h:commandButton onclick="return false;" id="targetButton"
value="Target" /><br />
+
+ <button onclick="${rich:component('me')}.add()">Turn Alt-A
On</button>
+ <button onclick="${rich:component('me')}.remove()">Turn
Alt-A Off</button><br />
+ <button onclick="${rich:component('you')}.add()">Turn Alt-L
On</button>
+ <button onclick="${rich:component('you')}.remove()">Turn
Alt-L Off</button><br />
+ </h:panelGroup>
+ </h:panelGroup>
+
+ <h:selectBooleanCheckbox value="#{bean.rendered}">
+ <a4j:support event="onclick" reRender="panel" />
+ </h:selectBooleanCheckbox>
+
+ <a4j:commandButton value="ReRender" reRender="panel" />
+ </h:form>
</f:view>
</body>
</html>