Author |
Message |
15/07/2013 12:56:02
|
cfuchs
Active
Joined: 21/01/2013 09:33:01
Messages: 16
Offline
|
Hey,
I have developed my own client components which extend the regulary asynchronious upload and download functionality.
While there is not any problem when I remain on the same page (using onUebernehmen Event), the upload does not work when I change the Page (onOK Event).
Is there a way to solve this matter?
Pseudocode
Code:
public void onOK (ActionEvent event) {
startUpload();
goToLastSite();
}
public void onUebernehmen (ActionEvent event) {
startUpload();
}
private void startUpload() {
// Application processing
uploadTrigger.trigger();
}
My upload component looks like the FILEUPLOADASYNCHRONOUSElement with a few extensions.
Thanks in advance.
|
|
|
15/07/2013 13:39:54
|
Admin
Power User
Joined: 21/11/2007 11:36:10
Messages: 38
Offline
|
Hmm,
what type of upload components are using? Which one is the one you internally use by your own component?
What does "upload does not work" mean exactly?
Regards!
Björn
|
|
|
15/07/2013 14:46:43
|
cfuchs
Active
Joined: 21/01/2013 09:33:01
Messages: 16
Offline
|
Hi,
internally I am using the internal class FileUploader with the method startUploadFiles in order to upload multiple files.
By defining a parameter the component knows which files to upload without user interaction.
What I mean with "it does not work" - when I press the button for onUebernehmen, I get the upload dialog telling me the amount of files and the number of kilobytes which have been transfered until it is finished. Afterwards the upload finish method is called.
When I use the button for onOK event, it changes the page and I don't receive any upload dialog. The upload finish method is not called either.
I assume that the client loses the client component context as the page (jsp site) is changed and thus the invoke later event to start the upload fails.
Hope this information helps.
Regards,
Christian
|
|
|
15/07/2013 17:21:58
|
cfuchs
Active
Joined: 21/01/2013 09:33:01
Messages: 16
Offline
|
After debugging the Java Log, I have found out that my components are destroyed because I changed the pages (or rather beans associated with another jsp).
Thus, my question reduces to "Is it possible to have an client interaction which is executed before the server calls the client to tell him that the current bean has been changed?
|
|
|
17/07/2013 18:33:50
|
cfuchs
Active
Joined: 21/01/2013 09:33:01
Messages: 16
Offline
|
Okay, I have found a solution for the problem.
Actually, it is quite simple - I have only moved the page changing functionality into the callback method. Only at that point, it is clear that the client component has been fully executed and that the page can be changed.
Only thing one has to pay attention to is that in case of an error within the client component, the server must be still called in order to execute the callback method. Otherwise, the page won't changed.
|
|
|
|