Author: mvitenkov
Date: 2008-07-01 12:07:41 -0400 (Tue, 01 Jul 2008)
New Revision: 9326
Modified:
trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp
Log:
+findComponent
Modified: trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp 2008-07-01 16:06:57 UTC
(rev 9325)
+++ trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp 2008-07-01 16:07:41 UTC
(rev 9326)
@@ -4,19 +4,23 @@
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="hotKeySubviewID">
- <rich:calendar id="hotKeyCalendarID" popup="false"/>
- <h:commandButton id="commandButtonID" onclick="return false;"
value="test select"></h:commandButton>
- <rich:hotKey id="hotKeyID" binding="#{hotKey.binding}"
- disableInInput="#{hotKey.disableInInput}"
handler="#{hotKey.handler}" key="#{hotKey.key}"
- rendered="#{hotKey.rendered}" selector="#{hotKey.selector}"
timing="#{hotKey.timing}"/>
+ <rich:calendar id="hotKeyCalendarID" popup="false" />
+
+
+ <h:commandButton id="commandButtonID" onclick="return false;"
+ value="test select"></h:commandButton>
+ <rich:hotKey id="hotKeyID" binding="#{hotKey.binding}"
+ disableInInput="#{hotKey.disableInInput}"
handler="#{hotKey.handler}"
+ key="#{hotKey.key}" rendered="#{hotKey.rendered}"
+ selector="#{hotKey.selector}" timing="#{hotKey.timing}" />
- <h:panelGrid columns="2">
+ <h:panelGrid columns="2">
<h:outputText value="type"></h:outputText>
<h:selectOneMenu value="#{hotKey.type}">
- <f:selectItem itemLabel="onkeydown"
itemValue="onkeydown"/>
- <f:selectItem itemLabel="onkeypress"
itemValue="onkeypress"/>
- <f:selectItem itemLabel="onkeyup" itemValue="onkeyup"/>
- <a4j:support reRender="hotKeyID"
event="onchange"></a4j:support>
+ <f:selectItem itemLabel="onkeydown" itemValue="onkeydown"
/>
+ <f:selectItem itemLabel="onkeypress" itemValue="onkeypress"
/>
+ <f:selectItem itemLabel="onkeyup" itemValue="onkeyup" />
+ <a4j:support reRender="hotKeyID"
event="onchange"></a4j:support>
</h:selectOneMenu>
<h:outputText value="key"></h:outputText>
@@ -25,22 +29,24 @@
<h:outputText value="timing"></h:outputText>
<h:selectOneMenu value="#{hotKey.timing}"
onchange="submit();">
- <f:selectItem itemLabel="onload" itemValue="onload"/>
- <f:selectItem itemLabel="immediate" itemValue="immediate"/>
+ <f:selectItem itemLabel="onload" itemValue="onload" />
+ <f:selectItem itemLabel="immediate" itemValue="immediate"
/>
</h:selectOneMenu>
<h:outputText value="selector"></h:outputText>
<h:selectOneMenu value="#{hotKey.selector}">
- <f:selectItem itemLabel="" itemValue=""/>
- <f:selectItem itemLabel="Button"
itemValue="#commandButtonID"/>
+ <f:selectItem itemLabel="" itemValue="" />
+ <f:selectItem itemLabel="Button" itemValue="#commandButtonID"
/>
<a4j:support reRender="hotKeyID"
event="onchange"></a4j:support>
</h:selectOneMenu>
<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('work')"
itemLabel="alert('work')"/>
+ <f:selectItem
+ itemValue="$('formID:hotKeySubviewID:hotKeyCalendarID').component.nextYear();"
+ itemLabel="nextYear(Calendar)" />
+ <f:selectItem itemValue="alert('work')"
itemLabel="alert('work')" />
</h:selectOneMenu>
<h:outputText value="disableInInput"></h:outputText>
@@ -60,30 +66,65 @@
<h:outputText value="test binding:"></h:outputText>
<h:outputText value="#{hotKey.bindingInfo}"></h:outputText>
-
- <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>
+
+ <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"/>
+ <rich:hotKey id="jsID" timing="onregistercall" />
- <h:panelGrid columns="2">
+ <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('formID:hotKeySubviewID:jsID').component.add({selector:'#formID\\:hotKeySubviewID\\:commandButtonID',
key:'alt+x',handler:function(){alert('alt+x');}}); return false;"
value="add js: alt+x"></h:commandLink>
- <h:commandLink id="jsRemoveJSID"
onclick="document.getElementById('formID:hotKeySubviewID:jsID').component.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\:hotKeySubviewID\:commandButtonID" />
+ <h:commandLink id="jsAddJSID"
+ onclick="document.getElementById('formID:hotKeySubviewID:jsID').component.add({selector:'#formID\\:hotKeySubviewID\\:commandButtonID',
key:'alt+x',handler:function(){alert('alt+x');}}); return false;"
+ value="add js: alt+x"></h:commandLink>
+ <h:commandLink id="jsRemoveJSID"
+ onclick="document.getElementById('formID:hotKeySubviewID:jsID').component.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\:hotKeySubviewID\: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 disableDefault="true"
attachTo="jsRemoveCCID"
+ for="jsID" event="onclick" operation="remove">
</rich:componentControl>
- </h:panelGrid>
+
+ </h:panelGrid>
+ <br />
+ <br />
+ <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
+ <h:panelGrid columns="2">
+ <rich:column>
+ <a4j:commandLink value="getRendererType"
reRender="findID"></a4j:commandLink>
+ </rich:column>
+ <rich:column id="findID">
+ <h:outputText
value="#{rich:findComponent('hotKeyID').rendererType}" />
+ </rich:column>
+ </h:panelGrid>
</f:subview>
\ No newline at end of file