Author: mvitenkov
Date: 2008-07-02 09:00:21 -0400 (Wed, 02 Jul 2008)
New Revision: 9389
Modified:
trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanel.xhtml
Log:
+findComponent
Modified: trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanel.xhtml
===================================================================
---
trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanel.xhtml 2008-07-02
12:57:33 UTC (rev 9388)
+++
trunk/test-applications/facelets/src/main/webapp/ModalPanel/ModalPanel.xhtml 2008-07-02
13:00:21 UTC (rev 9389)
@@ -5,13 +5,21 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich" id="modalPanelSubviewID">
-
+ <script type="text/javascript">
+ function multiply(height,width){
+ var tbody = document.getElementById('tbodyID');
+ var trs = tbody.getElementsByTagName('TR');
+ var y = parseInt(height);
+ var x = parseInt(width);
+ trs[1].innerHTML = 'modalPanel\'s size: ' + x*y + ' px*px';
+ return false;
+ }
+</script>
<h:selectOneMenu value="#{richBean.srcContainer}"
onchange="submit();">
<f:selectItems value="#{richBean.listContainer}" />
</h:selectOneMenu>
- <rich:modalPanel id="modalPanelID"
- left="#{modalPanel.left}"
+ <rich:modalPanel id="modalPanelID" left="#{modalPanel.left}"
top="#{modalPanel.top}" minHeight="#{modalPanel.minHeight}"
minWidth="#{modalPanel.minWidth}" height="#{modalPanel.height}"
width="#{modalPanel.width}" moveable="#{modalPanel.moveable}"
@@ -21,7 +29,7 @@
autosized="#{modalPanel.autosized}"
shadowDepth="#{modalPanel.shadowDepth}"
shadowOpacity="#{modalPanel.shadowOpacity}"
- showWhenRendered="#{modalPanel.showWhenRendered}"
+ showWhenRendered="#{modalPanel.showWhenRendered}"
headerClass="#{style.headerClass}"
styleClass="#{style.styleClass}"
onhide="#{event.onhide}" onmaskclick="#{event.onmaskclick}"
onmaskcontextmenu="#{event.onmaskcontextmenu}"
@@ -31,8 +39,7 @@
onmaskmouseout="#{event.onmaskmouseout}"
onmaskmouseover="#{event.onmaskmouseover}"
onmaskmouseup="#{event.onmaskmouseup}" onmove="#{event.onmove}"
- onresize="#{event.onresize}" onshow="#{event.onshow}"
- >
+ onresize="#{event.onresize}" onshow="#{event.onshow}">
<f:facet name="header">
<h:outputText value="Heder goes here..." />
</f:facet>
@@ -40,19 +47,32 @@
<h:graphicImage value="/pics/error.gif"
onclick="Richfaces.hideModalPanel('modalPanelID');return false;"
/>
</f:facet>
+ <br />
+ <br />
+ <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
+ <h:panelGrid columns="2" id="findComponentID">
+ <tbody id="tbodyID">
+ <tr>
+ <td><a4j:commandLink value="getSize" reRender="findID"
+ onclick="javascript:multiply(#{rich:findComponent('modalPanelID').height},#{rich:findComponent('modalPanelID').width});"></a4j:commandLink>
+ </td>
+ </tr>
+ <tr>
+ <td><h:outputText /></td>
+ </tr>
+ </tbody>
+ </h:panelGrid>
+ <br />
<h:outputText value="This is Modal Panel example"
styleClass="text1" />
<h:selectOneMenu value="#{richBean.srcContainer}"
onchange="submit();">
<f:selectItems value="#{richBean.listContainer}" />
</h:selectOneMenu>
-
+
<applet code="ArcTest.class" width="400" height="400"
-
codebase="http://java.sun.com/applets/jdk/1.4/demo/applets/ArcTest/&...
-
alt="Your browser understands the <APPLET> tag but isn't
running the applet, for some reason.">
- Your browser is completely ignoring the <APPLET> tag!
- </applet>
+ Your browser is completely ignoring the <APPLET> tag! </applet>
<h:inputText value="#{modalPanel.inputTextTest}" />
<h:selectOneListbox value="#{modalPanel.selectOneListboxTest}">
<f:selectItem itemLabel="1" itemValue="1" />
@@ -88,45 +108,61 @@
value="Close">
<f:verbatim>Close</f:verbatim>
</h:outputLink>
-
+
</rich:modalPanel>
-
+
<rich:modalPanel id="modalPanelID2">
- <f:facet name="controls">
+ <f:facet name="controls">
<h:graphicImage value="/pics/error.gif"
onclick="Richfaces.hideModalPanel('modalPanelID2');return false;"
/>
<h:form>
<a4j:commandLink action="#"
- oncomplete="Richfaces.hideModalPanel('modalPanelID2')"
value="close" />
+ oncomplete="Richfaces.hideModalPanel('modalPanelID2')"
+ value="close" />
</h:form>
</f:facet>
<h:inputText value="#{sb.property}" id="text" />
- <rich:suggestionbox id="suggestionBoxId"
eventsQueue="myEventsQueue" ajaxSingle="#{sb.ajaxSingle}"
dir="#{sb.dir}"
- rendered="#{sb.rendered}" requestDelay="#{sb.requestDelay}"
selfRendered="#{sb.selfRendered}" value="#{sb.value}"
for="text"
- var="result" fetchValue="#{result.text}"
suggestionAction="#{sb.autocomplete}" width="#{sb.width}"
height="#{sb.height}"
- border="#{sb.border}" zindex="#{sb.zindex}"
rules="#{sb.rules}" cellpadding="#{sb.cellpadding}"
- cellspacing="#{sb.cellspacing}" first="#{sb.first}"
minChars="#{sb.minchars}" tokens="#{sb.tokens}"
bgcolor="#{sb.bgColor}"
- focus="#{sb.forcus}" title="#{result.text}"
summary="summary" shadowOpacity="#{sb.shadowOpacity}"
- shadowDepth="#{sb.shadowDepth}" selectValueClass="mousemove"
frequency="#{sb.frequency}" nothingLabel="nothingLabel work! "
- entryClass="#{style.entryClass}" popupClass="#{style.popupClass}"
popupStyle="#{style.popupStyle}" style="#{style.style}"
styleClass="#{style.styleClass}"
selectedClass="#{style.selectedClass}"
rowClasses="#{style.rowClasses}"
- oncomplete="#{event.oncomplete}" onselect="#{event.onselect}"
onbeforedomupdate="#{event.onbeforedomupdate}"
onsubmit="#{event.onsubmit}">
- <h:column>
- <h:outputText value="#{result.city}" />
- </h:column>
- <h:column>
- <h:outputText value="#{result.contry}" />
- </h:column>
- <h:column>
- <h:outputText value="#{result.flag}" />
- </h:column>
- <h:column>
- <h:outputLink
value="http://www.jboss.com/"><f:verbatim>Link</f:v...
- </h:column>
- </rich:suggestionbox>
+ <rich:suggestionbox id="suggestionBoxId"
eventsQueue="myEventsQueue"
+ ajaxSingle="#{sb.ajaxSingle}" dir="#{sb.dir}"
+ rendered="#{sb.rendered}" requestDelay="#{sb.requestDelay}"
+ selfRendered="#{sb.selfRendered}" value="#{sb.value}"
for="text"
+ var="result" fetchValue="#{result.text}"
+ suggestionAction="#{sb.autocomplete}" width="#{sb.width}"
+ height="#{sb.height}" border="#{sb.border}"
zindex="#{sb.zindex}"
+ rules="#{sb.rules}" cellpadding="#{sb.cellpadding}"
+ cellspacing="#{sb.cellspacing}" first="#{sb.first}"
+ minChars="#{sb.minchars}" tokens="#{sb.tokens}"
+ bgcolor="#{sb.bgColor}" focus="#{sb.forcus}"
title="#{result.text}"
+ summary="summary" shadowOpacity="#{sb.shadowOpacity}"
+ shadowDepth="#{sb.shadowDepth}" selectValueClass="mousemove"
+ frequency="#{sb.frequency}" nothingLabel="nothingLabel work! "
+ entryClass="#{style.entryClass}" popupClass="#{style.popupClass}"
+ popupStyle="#{style.popupStyle}" style="#{style.style}"
+ styleClass="#{style.styleClass}"
+ selectedClass="#{style.selectedClass}"
+ rowClasses="#{style.rowClasses}" oncomplete="#{event.oncomplete}"
+ onselect="#{event.onselect}"
+ onbeforedomupdate="#{event.onbeforedomupdate}"
+ onsubmit="#{event.onsubmit}">
+ <h:column>
+ <h:outputText value="#{result.city}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{result.contry}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{result.flag}" />
+ </h:column>
+ <h:column>
+ <h:outputLink
value="http://www.jboss.com/">
+ <f:verbatim>Link</f:verbatim>
+ </h:outputLink>
+ </h:column>
+ </rich:suggestionbox>
</rich:modalPanel>
<a onclick="Richfaces.showModalPanel('modalPanelID');"
href="#">Show
MP</a>
- <br/>
+ <br />
<a onclick="Richfaces.showModalPanel('modalPanelID2');"
href="#">Show
MP2</a>