Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.0
-
Fix Version/s: 3.0.1, EE-3.0.0.GA
-
Component/s: ACE-Components
-
Labels:None
-
Environment:Windows 7, NetBeans 6.9.1, Apache Tomcat 6.0.26, JSF 2.0, IceFaces 2.0
Description
I am no really sure if this is a bug, but I have encoutered a problem with my registration page when I tried to add FileEntry component there. When I send the data through h:commandButton to the bean it converts Strings into bad format (for example "Někdo" into "NÄ›kdo"). Everything is working ok without fileEntry. I also enclose some source codes. So now I have separeted it into two pages - one for data and second one for files, but I would rather have it on a single page.
This is my fileEntry component on a page
#{registerPage.photo}: <ace:fileEntry absolutePath="C:/uploaded/" maxFileCount="1"
label="File Upload"
fileEntryListener="#{registration.fileListener}"
useOriginalFilename="true"
immediate="true"
id="photo"/>]
and this the file listener in bean
public void fileListener(FileEntryEvent event) {
FileEntry fileEntry = (FileEntry) event.getSource();
String id = fileEntry.getId();
FileEntryResults results = fileEntry.getResults();
for (FileEntryResults.FileInfo fileInfo : results.getFiles()) {
if (fileInfo.isSaved()) {
setPhoto(fileInfo.getFile().getPath());
}
}
The listener, getters and setters for data and action method is all in the same bean (registration)
This is my fileEntry component on a page
#{registerPage.photo}: <ace:fileEntry absolutePath="C:/uploaded/" maxFileCount="1"
label="File Upload"
fileEntryListener="#{registration.fileListener}"
useOriginalFilename="true"
immediate="true"
id="photo"/>]
and this the file listener in bean
public void fileListener(FileEntryEvent event) {
FileEntry fileEntry = (FileEntry) event.getSource();
String id = fileEntry.getId();
FileEntryResults results = fileEntry.getResults();
for (FileEntryResults.FileInfo fileInfo : results.getFiles()) {
if (fileInfo.isSaved()) {
setPhoto(fileInfo.getFile().getPath());
}
}
The listener, getters and setters for data and action method is all in the same bean (registration)
Issue Links
- is duplicated by
-
ICE-7778 ace:fileEntry component affect input components when special characters are used
- Closed
We have the same issue. The character-encoding is ignored in case of multipart-stream. I fixed this in the FileEntryPhaseListener.
The patch (/tags/icefaces-2.0.2) is attached.