-
1. Re: a4j:mediaOutput problem in firefox
sergeysmirnov Dec 14, 2007 2:22 AM (in response to daedlus)does the value attribute is changed during the requests?
-
2. Re: a4j:mediaOutput problem in firefox
daedlus Dec 14, 2007 3:14 AM (in response to daedlus)the value attribute is not changed.It has some constants defined.-width,height,etc
-
3. Re: a4j:mediaOutput problem in firefox
ilya_shaikovsky Dec 14, 2007 9:19 AM (in response to daedlus)add some random prefics to value to prevent caching.
-
4. Re: a4j:mediaOutput problem in firefox
sergeysmirnov Dec 14, 2007 12:24 PM (in response to daedlus)What it the version of the RichFaces (Ajax4jsf), BTW? It was a bug sometime ago when cacheable="false" was ignored.
-
5. Re: a4j:mediaOutput problem in firefox
daedlus Dec 15, 2007 4:16 AM (in response to daedlus)am using 3.1.2 GA.
adding random prefix to value , how?
currently ImageCustomizer has constants declared, do i create a private member in ImageCustomizer and assign it a random value in its getter?
or
u mean like this?
value="#{myBean.randomNumber}#{imageCustomizer}" -
6. Re: a4j:mediaOutput problem in firefox
daedlus Dec 21, 2007 12:57 AM (in response to daedlus)ok..if value is varied every time then it works in Firefox.
-
7. Re: a4j:mediaOutput problem in firefox
jaymuc Apr 14, 2008 9:51 AM (in response to daedlus)After upload a new image, firefox not show the new image until you clear cache. works fine in IE. It is possible to make the value param dynamic?
jspx<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}" maxFilesQuantity="#{fileUploadBean.uploadsAvailable}" immediateUpload="#{fileUploadBean.autoUpload}" acceptedTypes="jpg, gif, png, bmp" listHeight="60"> <f:facet name="label"> <h:outputText value="#{msg.rich_file_upload_label}"/> </f:facet> <a4j:support event="onuploadcomplete" reRender="preview"/> </rich:fileUpload> <rich:dataGrid value="#{fileUploadBean.files}" var="file" columns="1" rowKeyVar="row"> <a4j:commandLink action="#{fileUploadBean.clearUploadData}" reRender="upload,preview"> <a4j:mediaOutput cacheable="false" rendered="#{fileUploadBean.size == 1}" element="img" mimeType="image/jpeg" createContent="#{fileUploadBean.paint}" value="#{row}" border="0" style="max-height:200px; max-width: 166px;"/> </a4j:commandLink> </rich:dataGrid>
FileUploadBean.class@Stateful @Name("fileUploadBean") @Scope(ScopeType.SESSION) public class FileUploadBean implements FileUploadBeanIF { private ArrayList<File> files = new ArrayList<File>(); private int uploadsAvailable = 1; private boolean autoUpload = true; public int getSize() { if (getFiles().size()>0){ return getFiles().size(); }else { return 0; } } @Destroy @Remove public void remove(){} public FileUploadBean() { } public void paint(OutputStream stream, Object object) throws IOException { stream.write(getFiles().get((Integer)object).getData()); } public void listener(UploadEvent event) throws IOException { UploadItem item = event.getUploadItem(); File file = new File(); file.setLength(item.getData().length); file.setName(item.getFileName()); file.setData(item.getData()); file.setUploadDate(new Date(System.currentTimeMillis())); files.add(file); uploadsAvailable--; } public String clearUploadData() { files.clear(); setUploadsAvailable(1); return null; } public ArrayList<File> getFiles() { return files; } public void setFiles(ArrayList<File> files) { this.files = files; } public int getUploadsAvailable() { return uploadsAvailable; } public void setUploadsAvailable(int uploadsAvailable) { this.uploadsAvailable = uploadsAvailable; } public boolean isAutoUpload() { return autoUpload; } public void setAutoUpload(boolean autoUpload) { this.autoUpload = autoUpload; } }
File.classpublic class File implements Serializable { private String Name; private long length; private Date uploadDate; private byte[] data; public byte[] getData() { return data; } public void setData(byte[] data) { this.data = data; } public String getName() { return Name; } public void setName(String name) { Name = name; } public long getLength() { return length; } public void setLength(long length) { this.length = length; } public Date getUploadDate() { return uploadDate; } public void setUploadDate(Date uploadDate) { this.uploadDate = uploadDate; } }
-
8. Re: a4j:mediaOutput problem in firefox
ilya_shaikovsky Apr 14, 2008 10:53 AM (in response to daedlus)please read above how it was fixed for daedlus ;)