Author: mvitenkov
Date: 2008-07-01 10:31:44 -0400 (Tue, 01 Jul 2008)
New Revision: 9322
Modified:
trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp
Log:
+findComponent
Modified: trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp 2008-07-01
14:09:47 UTC (rev 9321)
+++ trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp 2008-07-01
14:31:44 UTC (rev 9322)
@@ -2,18 +2,16 @@
<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
-<style>
-.addButton{
-color:white;
-background-color:red;
-}
+<style>
+.addButton {
+ color: white;
+ background-color: red;
+}
</style>
<f:subview id="FileUploadSubviewID">
<rich:fileUpload id="fileUploadID" status="a4jStatusID"
- onadd="#{event.onadd}"
- immediate="#{fileUpload.immediate}"
- ajaxSingle="#{fileUpload.ajaxSingle}"
- uploadData="#{fileUpload.data}"
+ onadd="#{event.onadd}" immediate="#{fileUpload.immediate}"
+ ajaxSingle="#{fileUpload.ajaxSingle}"
uploadData="#{fileUpload.data}"
acceptedTypes="#{fileUpload.acceptedTypes}"
disabled="#{fileUpload.disabled}"
autoclear="#{fileUpload.autoclear}"
required="#{fileUpload.required}"
requiredMessage="#{item.fileName}"
@@ -24,19 +22,19 @@
fileUploadListener="#{fileUpload.fileUploadListener}"
onuploadcanceled="#{event.onuploadcanceled}"
onclear="#{event.onclear}" onblur="#{event.onblur}"
- onchange="#{event.onchange}" onclick="#{event.onclick}"
+ onchange="#{event.onchange}" onclick="alert('onclick!!')"
ondblclick="#{event.ondblclick}" onerror="#{event.onerror}"
onfocus="#{event.onfocus}" onkeydown="#{event.onkeydown}"
onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}"
onmousedown="#{event.onmousedown}"
onmousemove="#{event.onmousemove}"
- onmouseout="#{event.onmousemout}"
onmouseover="#{event.onmouseover}"
- onmouseup="#{event.onmouseup}" onselect="#{event.onselect}"
- onsizerejected="#{event.onsizerejected}"
+ onmouseout="#{event.onmousemout}"
+ onmouseover="alert('onmouseover work')"
onmouseup="#{event.onmouseup}"
+ onselect="#{event.onselect}"
onsizerejected="#{event.onsizerejected}"
ontyperejected="#{event.ontyperejected}"
onupload="#{event.onupload}"
onuploadcomplete="#{event.onuploadcomplete}" accesskey="y"
alt="alternative" binding="#{fileUpload.myFileUpload}"
addButtonClass="#{fileUpload.addButtonClass}"
- addButtonClassDisabled="#{fileUpload.addButtonClassDisabled}"
+ addButtonClassDisabled="#{fileUpload.addButtonClassDisabled}"
cleanButtonClass="#{fileUpload.cleanButtonClass}"
cleanButtonClassDisabled="#{fileUpload.cleanButtonClassDisabled}"
fileEntryClass="#{fileUpload.fileEntryClass}"
@@ -56,13 +54,13 @@
stopControlLabel="stopControl"
stopEntryControlLabel="stopEntryControl"
transferErrorLabel="transferError"
uploadControlLabel="uploadControl"
- allowFlash="#{fileUpload.allowFlash}">
+ allowFlash="#{fileUpload.allowFlash}">
<f:facet name="label">
<h:outputText value="{_KB}KB from {KB}KB uploaded :[ {mm}:{ss}
]"></h:outputText>
</f:facet>
<f:facet name="header">
<h:outputText value="some text"></h:outputText>
- </f:facet>
+ </f:facet>
</rich:fileUpload>
<h:panelGrid columns="2">
@@ -135,21 +133,21 @@
<h:selectBooleanCheckbox value="#{fileUpload.ajaxSingle}">
<a4j:support event="onchange"
reRender="fileUploadID"></a4j:support>
</h:selectBooleanCheckbox>
-
+
<h:outputText value="immediate"></h:outputText>
<h:selectBooleanCheckbox value="#{fileUpload.immediate}">
<a4j:support event="onchange"
reRender="fileUploadID"></a4j:support>
</h:selectBooleanCheckbox>
-
+
<h:outputText value="Uploaded data:"></h:outputText>
<h:outputText value="#{fileUpload.changedLabel}"></h:outputText>
-
+
<h:outputText value="allowFlash" />
<h:selectOneRadio value="#{fileUpload.allowFlash}">
- <f:selectItem itemValue="true" itemLabel="true"/>
- <f:selectItem itemValue="false" itemLabel="false"/>
- <f:selectItem itemValue="auto" itemLabel="auto"/>
- <a4j:support event="onchange"
reRender="fileUploadID"></a4j:support>
+ <f:selectItem itemValue="true" itemLabel="true" />
+ <f:selectItem itemValue="false" itemLabel="false" />
+ <f:selectItem itemValue="auto" itemLabel="auto" />
+ <a4j:support event="onchange"
reRender="fileUploadID"></a4j:support>
</h:selectOneRadio>
<a4j:commandLink
@@ -167,20 +165,34 @@
</h:panelGrid>
<br />
<f:verbatim>
- <h:outputText value="Component controll" style="FONT-WEIGHT:
bold;"></h:outputText>
+ <h:outputText value="Component controll" style="FONT-WEIGHT:
bold;"></h:outputText>
+ <br />
+ <a href="#" id="enableID">enable()</a>
+ <br />
+ <a href="#" id="disableID">disable()</a>
+ <br />
+ <a href="#" id="stopID">stop()</a>
+ <br />
+ <a href="#" id="clearID">clear()</a>
+ </f:verbatim>
+
+ <rich:componentControl attachTo="enableID" event="onclick"
+ for="fileUploadID"
operation="enable"></rich:componentControl>
+ <rich:componentControl attachTo="disableID" event="onclick"
+ for="fileUploadID"
operation="disable"></rich:componentControl>
+ <rich:componentControl attachTo="stopID" event="onclick"
+ for="fileUploadID"
operation="stop"></rich:componentControl>
+ <rich:componentControl attachTo="clearID" event="onclick"
+ for="fileUploadID"
operation="clear"></rich:componentControl>
<br />
- <a href="#" id="enableID">enable()</a>
<br />
- <a href="#" id="disableID">disable()</a>
- <br />
- <a href="#" id="stopID">stop()</a>
- <br />
- <a href="#" id="clearID">clear()</a>
- </f:verbatim>
-
- <rich:componentControl attachTo="enableID" event="onclick"
for="fileUploadID"
operation="enable"></rich:componentControl>
- <rich:componentControl attachTo="disableID" event="onclick"
for="fileUploadID"
operation="disable"></rich:componentControl>
- <rich:componentControl attachTo="stopID" event="onclick"
for="fileUploadID" operation="stop"></rich:componentControl>
- <rich:componentControl attachTo="clearID" event="onclick"
for="fileUploadID"
operation="clear"></rich:componentControl>
-
+ <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
+ <h:panelGrid columns="2">
+ <rich:column>
+ <a4j:commandLink value="getFileName"
reRender="findID"></a4j:commandLink>
+ </rich:column>
+ <rich:column id="findID">
+ <h:outputText
value="#{rich:findComponent('fileUploadID').uploadData[0].fileName}"
/>
+ </rich:column>
+ </h:panelGrid>
</f:subview>
\ No newline at end of file