-
1. Re: FileUpload and "onuploadcomplete" reRender
ilya_shaikovsky Mar 9, 2010 10:04 AM (in response to ccaspanello)1) check last request execution in a4j:log for errors
2) about the loading icon. Actually auplaods by Ajax not possible because of security restrictions. So actually it occurs because we simulates assynchronous requests using submit in iframe. B.t.w. if Flash is not prohibited for usage in your applications - turn it on. There should be no such effect if upload handled by Flash.
-
2. Re: FileUpload and "onuploadcomplete" reRender
ccaspanello Apr 15, 2010 11:45 AM (in response to ilya_shaikovsky)Hey Ilya,
Tthanks for the reply and education. Come to find out my element was actually being rerendered; it just wasn't getting refreshed with the latest and greatest from the bean. Some java code fixed this.
Thanks again,
Chris
-
3. Re: FileUpload and "onuploadcomplete" reRender
desivanova Mar 29, 2011 7:43 AM (in response to ccaspanello)Hi Chris
I'm facing the same problem and can't find what is the problem with the components to do not be rerenderd after uploadcomplete. I tried to put the components that need to be refreshed in different tags(outputpanels, tables .. etc) and the problem remains .... If I refresh the page F5 all the components are refreshed as expected.
Please place some code here or explain what was wrong with your code.
Thanks in advance!
Desi
-
4. Re: FileUpload and "onuploadcomplete" reRender
ilya_shaikovsky Mar 30, 2011 4:33 AM (in response to desivanova)I'm not sure that Cris monitoring that thread as he solved his problem about a year ago
So please post your code and we will check for the problems there.
-
5. Re: FileUpload and "onuploadcomplete" reRender
desivanova Mar 30, 2011 12:36 PM (in response to ilya_shaikovsky)Seems that the problem exist with jsf 2, because when I downgraded to 1.2 (jboss5 is delivered with jsf1.2 in) the control works perfectlly.
The code is:
<rich:fileUpload
fileUploadListener="#{fileUploadBean.listener}"
maxFilesQuantity="1" id="fileUploadId"
immediateUpload="true"
acceptedTypes="txt"
allowFlash="true" >
<a4j:support event="onuploadcomplete" reRender="scdocid" />
<a4j:support event="onclear" reRender="fileUploadId,scdocid" action="#{fileUploadBean.clearUploadData}"/>
</rich:fileUpload>
<h:panelGroup id="scdocid">
<table id="scftbl" class="infotbl" cellpadding="0" cellspacing="0">
<!-- information for file path just uploaded + number rows detected - file is plain text ->>
</table>
</h:panelGroup>
-
6. Re: FileUpload and "onuploadcomplete" reRender
ilya_shaikovsky Mar 31, 2011 5:14 AM (in response to desivanova)Please check a4j:log information about that last request.
P.S. if you moving to JSF 2 why not to try RF 4 ?
-
7. Re: FileUpload and "onuploadcomplete" reRender
desivanova Mar 31, 2011 7:57 AM (in response to ilya_shaikovsky)Thanks for responce
I checked log and there is a warning:
warn[14:36:18,523]: Node for replace by response with id mForm:j_id51:j_id234 not found in document
the form <h:form id="mForm"> encloses all components rich:fileUpload and results after uploading.
For now I use a workaround to refresh page with button 'Apply ..' button
But will be nice if you have idea about file upload and put it in modal panel. My initial desing was to show a button 'load file' and on this to attach modal panel where to put rich:fileupload. Unfortunatelly if I use this approach the listener is not fired at all. Can you give me a hint about this implementation.
here is a code:
<rich:modalPanel id="loadDocsPanel" autosized="true">
<f:facet name="header">
<h:outputText value="#{msg.UI_LOAD_DOC_FROM_FILE}" />
</f:facet>
<f:facet name="controls">
<h:graphicImage value="/images/buttons/bclose.gif"
onclick="Richfaces.hideModalPanel('loadDocsPanel')" />
</f:facet>
<a4j:form id="uploaderform">
<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
maxFilesQuantity="1" id="upload"
immediateUpload="#{fileUploadBean.autoUpload}"
acceptedTypes="#{fileUploadBean.acceptedTypes}"
allowFlash="#{fileUploadBean.useFlash}">
<a4j:support event="onuploadcomplete" reRender="scInfo"
oncomplete="Richfaces.hideModalPanel('loadDocsPanel')" />
</rich:fileUpload>
</a4j:form>
</rich:modalPanel>
<a4j:commandButton id="selectFile"
value="#{msg.UI_LOAD_DOC_FROM_FILE }" ajaxSingle="true">
<rich:toolTip showEvent="onmouseover" direction="bottom-left"
value="#{msg.MSG_FILEUPLOAD_FORMAT}">
</rich:toolTip>
<rich:componentControl for="loadDocsPanel" attachTo="selectFile"
operation="show" event="onclick" />
</a4j:commandButton>
<h:panelGroup id="scInfo">
<table id="scftbl" class="infotbl" cellpadding="0" cellspacing="0">
<!-- information for file path just uploaded + number rows detected - file is plain text ->>
</table>
</h:panelGroup>
Is it possible at all to make it work
Desi
-
8. Re: FileUpload and "onuploadcomplete" reRender
ilya_shaikovsky Apr 4, 2011 9:14 AM (in response to desivanova)you sure that the modal panel not lying in any external forms?