-
1. Re: onuploadcomplete - doesn't fire (waits for ages)
j-pro Apr 17, 2008 2:03 PM (in response to j-pro)I've used firebug to look at the requests. The situation is on the screenshot below.
On the screenshot:
1. closed requests(with +) - are just the same as the one which comes second from the top(ends with "......employeePhotoTab_editForm%3Aj_id313&")
2. JScript errors at the bottom are repeated few times.
Here is my screenshot:
http://www.imagehosting.com/out.php/i1701644_firebug.jpg
I really hope that it will help.
Waiting for help... :( Thank you in advance. -
2. Re: onuploadcomplete - doesn't fire (waits for ages)
andrei_exadel Apr 18, 2008 8:35 AM (in response to j-pro)J-Pro,
Your example is uncomleted, so I can only assume how you show modal panel after ajax request started...
I think you use <a4j:status> component, in 'onstart' & 'onstop' attributes you show and hide panel by JS API.
Am I right?
As I understand you want to show panel until uploading will be completed.
The code above is not a correct way to do it.
Because:
1. Upload request is not ajax
2. There are many another ajax requests during file uploading (from progresBar for example)
The correct way:
Call show() method after upload started. (Use onuploadstart event. It will be implemented in a moment. Look at http://jira.jboss.com/jira/browse/RF-3119 )
Call hide() method after upload completed. (Use onuploadcomplete event).
Please let me know if I wrote something uncleared or if I understand you incorrectly. -
3. Re: onuploadcomplete - doesn't fire (waits for ages)
j-pro Apr 18, 2008 8:56 AM (in response to j-pro)"andrei_exadel" wrote:
J-Pro, Your example is uncomleted, so I can only assume how you show modal panel after ajax request started...
I think you use <a4j:status> component, in 'onstart' & 'onstop' attributes you show and hide panel by JS API.
Am I right?
Yes, you're absolutely right. Sorry, I've just forgot to give this piece of code:<a4j:status onstart="Richfaces.showModalPanel('ajaxLoadingModalBox',{width:350, top:200})" onstop="Richfaces.hideModalPanel('ajaxLoadingModalBox')"/>
"andrei_exadel" wrote:
As I understand you want to show panel until uploading will be completed.
No, actually vice versa: I want this panel to NOT show while uploading is in progress(to make user able to cancel it of he wants to), but show it while other ajax stuff is processing. That's why I have "onupload="Event.stop(event||window.event);"" in my fileUpload control. But as you said that "onuploadstart" is on the way - so I should use it this way to prevent modal panel from appearing while uploading: "onuploadstart="Event.stop(event||window.event);"", am I right?
And the question about the SUBJ: I've noticed that my modal panel disappears and appears again, only then it stucks. So I assume that it's reRendering problem. reRender - it's AJAX stuff(so the panel is showed). And as you can see on the screenshot - the digit "0" and mediaOutput were not rendered while file upload is finished. That's why my modal panel still holds on the screen(I waited almost for 30 minutes - it still holds on). That's the problem I've created the post. Are there any solutions to properly reRender needed controls and finish AJAX request(to let modal panel disappear)? -
4. Re: onuploadcomplete - doesn't fire (waits for ages)
andrei_exadel Apr 18, 2008 9:48 AM (in response to j-pro)OK, I understood.
You want to disable showing modalPanel for file uploading process.
But 'Event.stop(event||window.event);' is stopping current event.
It has no effect in this case.
I think the next solution can be applied: use 'status' attribute of component. You can define there non-existent status id. So ajax will process without component status switching.
But one problem: progressBar has status attribute, but fileUpload does not.
At the first try define "progress" facet inside the fileUpload and put there progressBar with 'status' attribute defined.
If you like this solution we can add 'status' attribute to fileUpload. -
5. Re: onuploadcomplete - doesn't fire (waits for ages)
j-pro Apr 18, 2008 3:59 PM (in response to j-pro)Dear Andrei, thanks again for your answers. I really appreciate it.
Sorry for bothering, but what do you thing about the main question for me: "question about the SUBJ" at the bottom of my last post? Can you help me with that? It's really important.use 'status' attribute of component. You can define there non-existent status id. So ajax will process without component status switching.
Maybe it's my week point here, because I don't understand it's sense. But still I've made some experiments with rich:progressBar and added "status=2344243" there - which helped me to prevent modal panel appearance. And it really would be nice to have such attribute in fileUpload(but since you said that fileUpload has many ajax requests, are you sure, that it helps? If yes - sure, it would be nice to have it there!).
And one more thing: would you please point me to any resource(in internet) where I can get into "status" attribute? (I saw the TLD, but "ID (in format of call UIComponent.findComponent()) of Request status component" doesn't tell me much). Because I really don't understand why if I specify unknown status, modalPanel isn't showing, but progress bar works properly. And in case of for example a4j:commandButton - this way is a wrong one, because if I specify such status - modal panel isn't showing, BUT commandButton doesn't work at all. Thanks for your answer, I really want to get into that!
Thanks again for your time, Andrei.