JBoss Rich Faces SVN: r10134 - trunk/framework/impl/src/main/java/org/ajax4jsf/request.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-08-19 05:25:11 -0400 (Tue, 19 Aug 2008)
New Revision: 10134
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
Log:
refactoring
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2008-08-19 08:51:28 UTC (rev 10133)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2008-08-19 09:25:11 UTC (rev 10134)
@@ -24,9 +24,7 @@
import javax.servlet.http.HttpServletRequestWrapper;
import org.ajax4jsf.Filter;
-import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.exception.FileUploadException;
-import org.ajax4jsf.webapp.BaseFilter;
import org.ajax4jsf.webapp.BaseXMLFilter;
import org.richfaces.model.UploadItem;
@@ -712,7 +710,7 @@
public List<UploadItem> getUploadItems () {
List <UploadItem> uploadItems = new ArrayList<UploadItem>();
for (String k : keys) {
- uploadItems.add(new UploadItem(getFileName(k), getFileContentType(k), getFile(k)));
+ uploadItems.add(new UploadItem(getFileName(k), getFileSize(k), getFileContentType(k), getFile(k)));
}
return uploadItems;
}
15 years, 10 months
JBoss Rich Faces SVN: r10133 - trunk/test-applications/jsp/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-08-19 04:51:28 -0400 (Tue, 19 Aug 2008)
New Revision: 10133
Modified:
trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-08-18 18:47:16 UTC (rev 10132)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-08-19 08:51:28 UTC (rev 10133)
@@ -6,6 +6,10 @@
<param-name>org.ajax4jsf.SKIN</param-name>
<param-value>#{skinBean.skin}</param-value>
</context-param>
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING_LEVEL</param-name>
+ <param-value>extended</param-value>
+ </context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
<param-value>#{skinning.skinningClass}</param-value>
@@ -20,7 +24,7 @@
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/faces-config-DataGrid.xml,/WEB-INF/faces-config-Validator.xml,/WEB-INF/faces-config-ComponentInfo.xml,/WEB-INF/faces-config-HotKey.xml,/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/W!
EB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-co!
nfig-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF
/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml</param-value>
+ <param-value>/WEB-INF/faces-config-DataGrid.xml,/WEB-INF/faces-config-Validator.xml,/WEB-INF/faces-config-ComponentInfo.xml,/WEB-INF/faces-config-HotKey.xml,/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/W!
EB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-RichTest.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-conf!
ig-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/fac
es-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
15 years, 10 months
JBoss Rich Faces SVN: r10132 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-08-18 14:47:16 -0400 (Mon, 18 Aug 2008)
New Revision: 10132
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
https://jira.jboss.org/jira/browse/RF-4201
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-08-18 18:04:55 UTC (rev 10131)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-08-18 18:47:16 UTC (rev 10132)
@@ -398,7 +398,9 @@
* user's JavaScript API
*/
showList : function() {
+ this.field.focus();
this.buttonClickHandler();
+ //this.comboList.isList = false;
},
hideList : function() {
15 years, 10 months
JBoss Rich Faces SVN: r10131 - in trunk/ui/inplaceSelect/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-08-18 14:04:55 -0400 (Mon, 18 Aug 2008)
New Revision: 10131
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4198
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-08-18 17:02:21 UTC (rev 10130)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-08-18 18:04:55 UTC (rev 10131)
@@ -38,14 +38,14 @@
return width;
},
- switchingStatesHandler : function($super, e) {
- var el = (e.srcElement) ? e.srcElement : e.target;
- if ((el.id == this.inplaceInput.id) || (e.type == "focus")) {
- $super(e);
- } else if(this.tempValueKeeper.style.display != "none") {
- this.tempValueKeeper.focus();
- }
- },
+ //switchingStatesHandler : function($super, e) {
+ //var el = (e.srcElement) ? e.srcElement : e.target;
+ //if (el.id == this.inplaceInput.id) {
+ //$super(e);
+ //} //else if(this.tempValueKeeper.style.display != "none") {
+ //this.tempValueKeeper.focus();
+ //}
+ //},
startEditableState : function($super) {
$super();
@@ -56,7 +56,6 @@
},
endEditableState : function($super) {
- this.inplaceInput.style.position = "";
$super();
this.button.hide();
},
@@ -69,15 +68,14 @@
buttonClickHandler : function(e) {
this.button.isClicked = true;
this.tempKeeperClickHandler();
- this.tempValueKeeper.focus();
+ //this.tempValueKeeper.focus();
Event.stop(e);
},
tmpValueBlurHandler : function($super, event) {
- if (this.clickOnBar || this.byTab || (Richfaces.browser.isIE && this.button.isClicked)) {
+ if (this.clickOnBar || (Richfaces.browser.isIE && this.button.isClicked)) {
//tab navigation&clickOnbar handler
this.clickOnBar = false;
- this.byTab = false;
this.button.isClicked = false;
return;
}
@@ -114,7 +112,7 @@
},
listClickHandler : function(event) {
- this.tempValueKeeper.focus();
+ //this.tempValueKeeper.focus();
this.comboList.hideWithDelay();
},
@@ -172,7 +170,6 @@
break;
case Event.KEY_TAB :
this.save();
- this.byTab = true;
break;
}
},
@@ -232,9 +229,9 @@
var text;
// IE6 support TODO: remove????
if (this.comboList.iframe) {
- text = this.inplaceInput.childNodes[7];
+ text = this.inplaceInput.childNodes[6];
} else {
- text = this.inplaceInput.childNodes[6];
+ text = this.inplaceInput.childNodes[5];
}
if (text) {
@@ -246,9 +243,9 @@
var currentText;
// IE6 support
if (this.comboList.iframe) {
- currentText = this.inplaceInput.childNodes[7];
- } else {
currentText = this.inplaceInput.childNodes[6];
+ } else {
+ currentText = this.inplaceInput.childNodes[5];
}
return currentText;
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-08-18 17:02:21 UTC (rev 10130)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-08-18 18:04:55 UTC (rev 10131)
@@ -58,7 +58,7 @@
outjectListFromBody: function(parentElement, listElement) {
if (this.listInjected) {
- var child = parentElement.insertBefore(document.body.removeChild(listElement), parentElement.childNodes[5]);
+ var child = parentElement.insertBefore(document.body.removeChild(listElement), parentElement.childNodes[3]);
if (Richfaces.browser.isIE6 && this.iframe) {
parentElement.insertBefore(document.body.removeChild(this.iframe), child);
}
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-08-18 17:02:21 UTC (rev 10130)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-08-18 18:04:55 UTC (rev 10131)
@@ -91,10 +91,9 @@
<jsp:scriptlet>
}
</jsp:scriptlet>
- <input id="#{clientId}tabber" type="button" value="" style="width: 1px; position: absolute; left: -32767px;" tabindex='#{component.attributes["tabindex"]}' />
<input id="#{clientId}inplaceTmpValue"
type="text"
- style='display:none;'
+ style='clip:rect(0px 0px 10px 10px)'
value="#{fieldLabel}"
autocomplete="off"
maxlength='#{component.attributes["inputMaxLength"]}'
15 years, 10 months
JBoss Rich Faces SVN: r10130 - trunk/framework/impl/src/main/java/org/ajax4jsf/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-08-18 13:02:21 -0400 (Mon, 18 Aug 2008)
New Revision: 10130
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
Log:
forcenotrf is on by default
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2008-08-18 15:37:39 UTC (rev 10129)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2008-08-18 17:02:21 UTC (rev 10130)
@@ -71,7 +71,7 @@
private boolean forcexml = false;
- private boolean forceNotRf = false;
+ private boolean forceNotRf = true;
private static final String FORCEXML_PARAMETER = "forceparser";
15 years, 10 months
JBoss Rich Faces SVN: r10129 - in trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html: scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-08-18 11:37:39 -0400 (Mon, 18 Aug 2008)
New Revision: 10129
Modified:
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
Log:
https://jira.jboss.org/jira/browse/RF-4213
https://jira.jboss.org/jira/browse/RF-4019
Modified: trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss
===================================================================
--- trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss 2008-08-18 14:37:06 UTC (rev 10128)
+++ trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss 2008-08-18 15:37:39 UTC (rev 10129)
@@ -13,7 +13,6 @@
.drgind_internal{
opacity:0.93;
filter:alpha(opacity=93);
- position : absolute;
}
.drgind_wordcut{
@@ -49,7 +48,7 @@
.rich-dragindicator-iframe {
position: absolute;
- display: block;
+ display: inline;
z-index: 999;
top: 0px;
left: 0px;
Modified: trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
===================================================================
--- trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js 2008-08-18 14:37:06 UTC (rev 10128)
+++ trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js 2008-08-18 15:37:39 UTC (rev 10129)
@@ -46,6 +46,12 @@
this._nextSibling = this.nextSibling;
}
this.realParent.removeChild(this);
+
+ if (this.iframe) {
+ this.realParent.removeChild(this.iframe);
+ document.body.appendChild(this.iframe);
+ }
+
document.body.appendChild(this);
this.floatedToBody = true;
}
@@ -62,11 +68,18 @@
this.leave();
if (this.floatedToBody && this.realParent) {
document.body.removeChild(this);
+
if (this._nextSibling) {
this.realParent.insertBefore(this, this._nextSibling);
} else {
this.realParent.appendChild(this);
}
+
+ if (this.iframe) {
+ document.body.removeChild(this.iframe);
+ this.realParent.insertBefore(this.iframe, this);
+ }
+
this.floatedToBody = false;
}
@@ -158,7 +171,7 @@
if (arguments.length > 0) {
if (show) {
- this.iframe.style.display = "block";
+ this.iframe.style.display = "";
} else {
this.iframe.style.display = "none";
}
@@ -231,10 +244,5 @@
]
)
]
- ),
- new E('div',
- {
- 'className':'drgind_shadow'
- }
)
];
15 years, 10 months
JBoss Rich Faces SVN: r10128 - trunk/samples/richfaces-demo/src/main/webapp/css.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-08-18 10:37:06 -0400 (Mon, 18 Aug 2008)
New Revision: 10128
Modified:
trunk/samples/richfaces-demo/src/main/webapp/css/common.css
Log:
RF-4207
Modified: trunk/samples/richfaces-demo/src/main/webapp/css/common.css
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/css/common.css 2008-08-18 13:04:45 UTC (rev 10127)
+++ trunk/samples/richfaces-demo/src/main/webapp/css/common.css 2008-08-18 14:37:06 UTC (rev 10128)
@@ -323,4 +323,8 @@
border-left-width:1px;
border-bottom-width:1px;
}
-
\ No newline at end of file
+
+/*RF-4207*/
+.rich-mpnl-controls {
+ z-index: 1;
+}
\ No newline at end of file
15 years, 10 months
JBoss Rich Faces SVN: r10127 - in trunk/ui/fileUpload/src/main: resources/org/richfaces/renderkit/html/js and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-08-18 09:04:45 -0400 (Mon, 18 Aug 2008)
New Revision: 10127
Modified:
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
RF-4209
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-08-18 13:04:38 UTC (rev 10126)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-08-18 13:04:45 UTC (rev 10127)
@@ -6,6 +6,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -23,7 +24,6 @@
import org.ajax4jsf.Filter;
import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.context.AjaxContextImpl;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
@@ -113,19 +113,17 @@
MultipartRequest multipartRequest = map.get(uid);
- clientId = clientId + ":file";
- boolean isFlash = false;
+ boolean isFlash = (requestParameterMap.get("_richfaces_send_http_error") != null);
- if (multipartRequest.getFileName(clientId) == null) {
- clientId = "Filedata"; // Flash mode
- isFlash = true;
+ List<UploadItem> fileList = multipartRequest.getUploadItems();
+
+ if (fileList == null || fileList.size() == 0) {
+ return;
}
+ boolean formUpload = multipartRequest.isFormUpload();
- String fileName = multipartRequest.getFileName(clientId);
- Object file = multipartRequest.getFile(clientId);
-
- if (isFlash) {
+ if (isFlash && !formUpload) {
try {
int actualSize = multipartRequest.getFileSize(clientId);
int clientSize = Integer.parseInt(requestParameterMap.get("_richfaces_size"));
@@ -137,12 +135,7 @@
return;
}
}
-
- fileUpload.setLocalFileName(fileName);
- fileUpload.setLocalContentType(multipartRequest.getFileContentType(clientId));
-
-
- onUploadComplete(context, file, fileUpload);
+ onUploadComplete(context, fileList, fileUpload, formUpload);
}
}
@@ -366,18 +359,17 @@
*/
@SuppressWarnings("unchecked")
private void storeData(FacesContext context, UIFileUpload fileUpload,
- Object file) {
+ List<UploadItem> fileList) {
ValueExpression data = fileUpload
.getValueExpression(_FILES_UPLOADED_ATTRIBUTE_NAME);
- UploadItem item = new UploadItem(fileUpload.getLocalFileName(), fileUpload.getLocalContentType(), file);
if (data != null) {
if (data.getValue(context.getELContext()) instanceof Collection) {
Collection collection = (Collection) data.getValue(context
.getELContext());
- collection.add(item);
+ collection.addAll(fileList);
}
}
- new UploadEvent(fileUpload, item).queue();
+ new UploadEvent(fileUpload, fileList).queue();
}
/**
@@ -387,15 +379,16 @@
* @param file
* @param fileUpload
*/
- private void onUploadComplete(FacesContext context, Object file,
- UIFileUpload fileUpload) {
- storeData(context, fileUpload, file);
+ private void onUploadComplete(FacesContext context, List<UploadItem> fileList,
+ UIFileUpload fileUpload, boolean formUpload) {
+ storeData(context, fileUpload, fileList);
try {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
if ((Boolean)fileUpload.getAttributes().get(AjaxRendererUtils.AJAX_SINGLE_ATTR)) {
ajaxContext.setAjaxSingleClientId(fileUpload.getClientId(context));
}
- ajaxContext.setAjaxRequest(true);
+
+ ajaxContext.setAjaxRequest(!formUpload);
} catch (Exception e) {
e.getMessage();
}
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-08-18 13:04:38 UTC (rev 10126)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-08-18 13:04:45 UTC (rev 10127)
@@ -1002,65 +1002,100 @@
if (!parentForm) {
throw "No parent form found!";
}
+ var formUpload = !(entry && entry instanceof FileUploadEntry);
- entry.uid = encodeURIComponent(Math.random().toString());
-
var oldTarget = parentForm.target;
var oldEnctype = parentForm.enctype;
var oldEncoding = parentForm.encoding;
var oldAction = parentForm.action;
-
- parentForm.encoding = "multipart/form-data";
- parentForm.enctype = "multipart/form-data";
- parentForm.target = this.id + "_iframe";//this.id;
- parentForm.action = this.actionUrl + (/\?/.test(this.actionUrl) ? '&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=' + encodeURI(entry.uid) + "&id=" + this.id + "&_richfaces_upload_file_indicator=true&AJAXREQUEST="+this.progressBar.containerId;
try {
- var inputs = parentForm.elements;
- var entryInput = entry.fileInput;
+ if (!formUpload) {
+ entry.uid = Math.random().toString();
+
+ parentForm.encoding = "multipart/form-data";
+ parentForm.enctype = "multipart/form-data";
+ parentForm.action = this.actionUrl + (/\?/.test(this.actionUrl) ? '&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=' + encodeURI(entry.uid) + "&id=" + this.id + "&_richfaces_upload_file_indicator=true"+"&AJAXREQUEST="+this.progressBar.containerId;
+ parentForm.target = this.id + "_iframe";
+
+ var inputs = parentForm.elements;
+ var entryInput = entry.fileInput;
- entryInput.name = this.id + ":file";
- entryInput.disabled = false;
+ entryInput.name = this.id + ":file";
+ entryInput.disabled = false;
- var l = inputs.length;
- for (var i = 0; i < l; i++) {
- var input = inputs[i];
- if (input != entryInput) {
- if ('file' == input.type) {
- input._disabled = input.disabled;
- input.disabled = true;
- }
+ var l = inputs.length;
+ for (var i = 0; i < l; i++) {
+ var input = inputs[i];
+ if (input != entryInput) {
+ if ('file' == input.type) {
+ input._disabled = input.disabled;
+ input.disabled = true;
+ }
+ }
}
+ }else {
+ this.beforeSubmit();
}
if (!parentForm.onsubmit || parentForm.onsubmit()) {
- this.watcher = new LoadWatcher(this.iframe, function(newState) {
- this.finishProgressBar();
- this.setState(newState);
- }.bind(entry),
- function (state) {
- this.updateViewState(state);
- }.bind(this));
+ if (!formUpload) {
+ this.watcher = new LoadWatcher(this.iframe, function(newState) {
+ this.finishProgressBar();
+ this.setState(newState);
+ }.bind(entry),
+ function (state) {
+ this.updateViewState(state);
+ }.bind(this));
+ }
_JSFFormSubmit(null, parentForm.id, null, this.parameters);
}
- for (var i = 0; i < l; i++) {
- var input = inputs[i];
- if ('file' == input.type) {
- input.disabled = input._disabled;
- input._disabled = undefined;
- }
+ if (!formUpload) {
+ for (var i = 0; i < l; i++) {
+ var input = inputs[i];
+ if ('file' == input.type) {
+ input.disabled = input._disabled;
+ input._disabled = undefined;
+ }
+ }
+ }else {
+ this._enableEntries(true);
}
} finally {
parentForm.action = oldAction;
- parentForm.target = oldTarget;
parentForm.encoding = oldEncoding;
parentForm.enctype = oldEnctype;
- this.getFileSizeScript(entry.uid, this.formId);
+ if (formUpload) {
+ this.currentInput.disabled = true;
+ }else {
+ parentForm.target = oldTarget;
+ this.getFileSizeScript(entry.uid, this.formId)
+ }
}
},
+ _enableEntries: function (b) {
+ for (var i = 0; i < this.entries.length; i++) {
+ var e = this.entries[i];
+ e.fileInput.name = (!b) ? (this.id + ":file" + i) : '';
+ e.fileInput.disabled = b;
+ }
+ },
+
+ beforeSubmit: function () {
+ var f = this.getForm();
+ if (!f) {
+ throw "No parent form found!";
+ }
+ f.encoding = f.enctype = "multipart/form-data";
+ f.action = this.actionUrl + (/\?/.test(this.actionUrl) ? '&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=_richfaces_form_upload' + "&id=" + this.id + "&_richfaces_upload_file_indicator=true";
+ this.currentInput.disabled = true;
+ this._enableEntries(false);
+ return true;
+ },
+
initFlashModule: function ()
{
var allowFlash = this.options.allowFlash;
15 years, 10 months
JBoss Rich Faces SVN: r10126 - in trunk/framework/impl/src/main/java/org/ajax4jsf: webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-08-18 09:04:38 -0400 (Mon, 18 Aug 2008)
New Revision: 10126
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
Log:
RF-4209
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2008-08-18 11:18:31 UTC (rev 10125)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2008-08-18 13:04:38 UTC (rev 10126)
@@ -28,6 +28,7 @@
import org.ajax4jsf.exception.FileUploadException;
import org.ajax4jsf.webapp.BaseFilter;
import org.ajax4jsf.webapp.BaseXMLFilter;
+import org.richfaces.model.UploadItem;
/**
* Request wrapper for supporting multipart requests, used for file uploading.
@@ -56,7 +57,7 @@
private Map<String, Object> percentMap = null;
- private Map<Object, Object> attributes = Collections.synchronizedMap(new HashMap<Object, Object>());
+ private List<String> keys = new ArrayList<String>();
private enum ReadState {
BOUNDARY, HEADERS, DATA
@@ -130,6 +131,7 @@
public FileParam(String name) {
super(name);
+ keys.add(name);
}
public Object getFile() {
@@ -707,6 +709,18 @@
return params;
}
+ public List<UploadItem> getUploadItems () {
+ List <UploadItem> uploadItems = new ArrayList<UploadItem>();
+ for (String k : keys) {
+ uploadItems.add(new UploadItem(getFileName(k), getFileContentType(k), getFile(k)));
+ }
+ return uploadItems;
+ }
+
+ public boolean isFormUpload() {
+ return "_richfaces_form_upload".equals(uid);
+ }
+
@Override
public String getHeader(String name) {
if (!"Accept".equals(name)) {
@@ -720,23 +734,7 @@
shouldStop = true;
}
-
@Override
- public Object getAttribute(String name) {
- Object o = attributes.get(name);
- if (o == null) {
- getRequest().getAttribute(name);
- }
- return o;
- }
-
- @Override
- public void setAttribute(String name, Object o) {
- attributes.put(name, o);
- getRequest().setAttribute(name, o);
- }
-
- @Override
public String getContentType() {
return "application/x-www-form-urlencoded";
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2008-08-18 11:18:31 UTC (rev 10125)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2008-08-18 13:04:38 UTC (rev 10126)
@@ -337,7 +337,8 @@
sessionsMap.put(uid, multipartRequest);
if (multipartRequest.parseRequest()) {
- handleRequest(multipartRequest, new HttpServletResponseWrapper(response){
+ handleRequest(multipartRequest, multipartRequest.isFormUpload() ? response :
+ new HttpServletResponseWrapper(response){
@Override
public void setContentType(String type) {
super.setContentType(BaseXMLFilter.TEXT_HTML + ";charset=UTF-8");
15 years, 10 months
JBoss Rich Faces SVN: r10125 - trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-08-18 07:18:31 -0400 (Mon, 18 Aug 2008)
New Revision: 10125
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
Log:
RF-4033
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-08-18 10:58:32 UTC (rev 10124)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-08-18 11:18:31 UTC (rev 10125)
@@ -39,7 +39,7 @@
public DataTableScrollerBean() {
initColumnsHeaders();
- SortField[] fields = {new SortField("price", true)};
+ SortField[] fields = {new SortField("make", true)};
order.setFields(fields);
}
15 years, 10 months