Author: ayanul
Date: 2008-06-26 07:06:48 -0400 (Thu, 26 Jun 2008)
New Revision: 9235
Modified:
trunk/test-applications/jsp/src/main/java/hotKey/HotKey.java
trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/java/hotKey/HotKey.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/hotKey/HotKey.java 2008-06-26 10:05:38 UTC
(rev 9234)
+++ trunk/test-applications/jsp/src/main/java/hotKey/HotKey.java 2008-06-26 11:06:48 UTC
(rev 9235)
@@ -17,7 +17,7 @@
public class HotKey {
private HtmlHotKey binding = null;
private String bindingInfo = "";
- private String handler = "alert('#{hotKey.key} is pressed')";
+ private String handler = "alert('work')";
private String key = "alt+a";
private String selector = "";
private String timing = "onload";
@@ -48,7 +48,7 @@
* @param handler the handler to set
*/
public void setHandler(String handler) {
- this.handler = handler;
+ this.handler = handler;
}
/**
* @return the key
Modified: trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp 2008-06-26 10:05:38 UTC
(rev 9234)
+++ trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp 2008-06-26 11:06:48 UTC
(rev 9235)
@@ -27,7 +27,6 @@
<h:selectOneMenu value="#{hotKey.timing}"
onchange="submit();">
<f:selectItem itemLabel="onload" itemValue="onload"/>
<f:selectItem itemLabel="immediate" itemValue="immediate"/>
- <f:selectItem itemLabel="onregistercall"
itemValue="onregistercall"/>
</h:selectOneMenu>
<h:outputText value="selector"></h:outputText>
@@ -41,7 +40,7 @@
<h:outputText value="handler"></h:outputText>
<h:selectOneMenu value="#{hotKey.handler}"
onchange="submit();">
<f:selectItem
itemValue="$('formID:hotKeySubviewID:hotKeyCalendarID').component.nextYear();"
itemLabel="nextYear(Calendar)"/>
- <f:selectItem itemValue="alert('#{hotKey.key} is pressed')"
itemLabel="alert(...)"/>
+ <f:selectItem itemValue="alert('work')"
itemLabel="alert('work')"/>
</h:selectOneMenu>
<h:outputText value="disableInInput"></h:outputText>
@@ -62,7 +61,27 @@
<h:outputText value="test binding:"></h:outputText>
<h:outputText value="#{hotKey.bindingInfo}"></h:outputText>
- <button onclick="${rich:component('hotKeyID')}.enable(); return
false;">turn on</button>
- <button onclick="${rich:component('hotKeyID')}.disable(); return
false;">turn off</button><br />
+ <h:commandButton onclick="#{rich:component('hotKeyID')}.enable();
return false;" value="enable"></h:commandButton>
+ <h:commandButton onclick="#{rich:component('hotKeyID')}.disable();
return false;" value="disable"></h:commandButton>
+ </h:panelGrid>
+
+ <rich:hotKey id="jsID" timing="onregistercall"/>
+
+ <h:panelGrid columns="2">
+ <h:commandButton id="jsAddCCID" value="add hotkey:
alt+z"></h:commandButton>
+ <h:commandButton id="jsRemoveCCID" value="remove hotkey:
alt+z"></h:commandButton>
+ <h:commandLink id="jsAddJSID"
onclick="document.getElementById('jsID').component.add({handler:function(){alert('alt+x');},
selector:'#formID\:commandButtonID', key:'alt+x'}); alert('hi');
return false;" value="add js: alt+x"></h:commandLink>
+ <h:commandLink id="jsRemoveJSID"
onclick="document.getElementById('jsID').remove(); return false;"
value="remove js: alt+x"></h:commandLink>
+ <h:commandButton onclick="#{rich:component('jsID')}.enable(); return
false;" value="enable"></h:commandButton>
+ <h:commandButton onclick="#{rich:component('jsID')}.disable(); return
false;" value="disable"></h:commandButton>
+
+ <rich:componentControl disableDefault="true"
attachTo="jsAddCCID" for="jsID" event="onclick"
operation="add">
+ <f:param name="selector" value="#formID\:commandButtonID"
/>
+ <f:param name="key" value="alt+z" />
+ <f:param name="handler" value="alert('alt+z')" />
+ </rich:componentControl>
+
+ <rich:componentControl disableDefault="true"
attachTo="jsRemoveCCID" for="jsID" event="onclick"
operation="remove">
+ </rich:componentControl>
</h:panelGrid>
</f:subview>
\ No newline at end of file
Show replies by date