Author: dsvyatobatsko
Date: 2008-03-17 08:56:34 -0400 (Mon, 17 Mar 2008)
New Revision: 6848
Modified:
trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2463 fileUpload: "listHeight" &
"listWidth" don't work without 'px' additive
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java 2008-03-17
12:56:27 UTC (rev 6847)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java 2008-03-17
12:56:34 UTC (rev 6848)
@@ -106,6 +106,14 @@
public abstract void setMaxFilesQuantity(Integer maxFilesQuantity);
+ public abstract String getListHeight();
+
+ public abstract void setListHeight(String listHeight);
+
+ public abstract String getListWidth();
+
+ public abstract void setListWidth(String listWidth);
+
public abstract String getStyleClass();
public abstract String getStyle();
Modified:
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
---
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-03-17
12:56:27 UTC (rev 6847)
+++
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-03-17
12:56:34 UTC (rev 6848)
@@ -37,6 +37,7 @@
import org.ajax4jsf.resource.CountingOutputWriter;
import org.richfaces.component.UIFileUpload;
import org.richfaces.component.UIProgressBar;
+import org.richfaces.component.util.HtmlUtil;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
@@ -500,6 +501,26 @@
}
/**
+ * Gets a string representing css specific height of downloaded file list panel.
+ *
+ * @param component file upload component
+ * @return a string representing css specific height of downloaded file list panel
+ */
+ public String getFileListHeight(UIFileUpload component) {
+ return HtmlUtil.qualifySize(component.getListHeight());
+ }
+
+ /**
+ * Gets a string representing css specific width of downloaded file list panel.
+ *
+ * @param component file upload component
+ * @return a string representing css specific width of downloaded file list panel
+ */
+ public String getFileListWidth(UIFileUpload component) {
+ return HtmlUtil.qualifySize(component.getListWidth());
+ }
+
+ /**
* Generate component custom events functions
*
* @param context
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-17
12:56:27 UTC (rev 6847)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-17
12:56:34 UTC (rev 6848)
@@ -40,15 +40,17 @@
variables.setVariable("addLabel",labels.get("add"));
variables.setVariable("uploadLabel",labels.get("upload"));
variables.setVariable("clearAllLabel",labels.get("clear_all"));
-
+
variables.setVariable("formId",getFormId(context, component));
variables.setVariable("containerId",getContainerId(context, component));
-
+
+ variables.setVariable("listWidth", getFileListWidth(component));
+ variables.setVariable("listHeight", getFileListHeight(component));
]]>
</jsp:scriptlet>
-
-<div class="upload_list_decor" style="width:
#{component.attributes['listWidth']}" id="#{clientId}">
+
+<div class="upload_list_decor" style="width: #{listWidth}"
id="#{clientId}">
<f:call name="utils.encodeBeginFormIfNessesary" />
<!-- iframe name="ddd" id="#{clientId}_iframe"
style="display: none;"/ -->
@@ -112,11 +114,11 @@
</td>
</tr>
</table>
-
- <div class="upload_list_overflow #{uploadListClass}" style="width:
100%; height: #{component.attributes['listHeight']}"
id="#{clientId}:fileItems">
-
+
+ <div class="upload_list_overflow #{uploadListClass}" style="width:
100%; height: #{listHeight}" id="#{clientId}:fileItems">
+
</div>
-
+
<span>
<script type="text/javascript">
FileUpload.CLASSES = {