Clear a file upload widget using javascript

348 views
Skip to first unread message

eduardo...@dedalusprime.com.br

unread,
Mar 5, 2015, 10:11:11 AM3/5/15
to suppor...@runmyprocess.com
Hi everybody,

My customer is creating an application where the user will upload some files, using the file upload widget, but then, the application needs to clear the widget, using client side javascript, so the user can upload new files. This process will repeat some times. He is trying to do a full CRUD page only using client side javascript.

He tried using the functions below:

widgetID.deleteSelected(): delete selected file
widgetID.selectFile(filename): select files with a given "filename"
widgetID.deselectFile(filename): deselect files with a given "filename"
widgetID.selectFileId(file_id): select files with a given id (RunMyProcess internal Id)
widgetID.deselectFileId(file_id): deselect files with a given id (RunMyProcess internal Id)
widgetID.refresh(): refresh list of loaded files

but it does not work, the files information are not cleared from the widget. It only works if the page is refreshed and this is something that he does not want to do.

How can he do this kind of development?

Thanks,

Eduardo
--


------------------------------
Confidencialidade: A informação contida nesta mensagem de e-mail,incluindo
quaisquer anexos, é confidencial e está reservada apenas à pessoa ou
entidade para a qual foi endereçada. Se você não é o destinatário ou a
pessoa responsável por encaminhar esta mensagem ao destinatário, você está,
por meio desta, notificado que não deverá rever, retransmitir, imprimir,
copiar, usar ou distribuir esta mensagem de e-mail ou quaisquer anexos.
Caso você tenha recebido esta mensagem por engano, por favor, contate o
remetente imediatamente e apague esta mensagem de seu computador ou de
qualquer outro banco de dados. Muito obrigado.

Bidisha Das

unread,
Mar 5, 2015, 10:49:41 PM3/5/15
to suppor...@runmyprocess.com
Hi,
I am not so clear about what exactly you want to do? You can upload multiple files using file upload widget.You don't have to clear the uploaded files for that.How are you using the functions which you mentioned above? Can you share your code. 

Basically if you want to use those js functions,you can take a js widget,get the value of the uploaded file using id_fileupload.getValue() and then perform the function you want to.In the listen to variables of the js,you need to use the file upload variable.

Please elaborate your requirement so that I can know what exactly you are trying to do.


Thanks & Regards
Bidisha

Eduardo Bortoluzzi Jr

unread,
Mar 6, 2015, 6:53:11 AM3/6/15
to suppor...@runmyprocess.com
Hi Bidisha,

Thanks for commenting this post.

This Web Interface will only upload the files, as you stated, and, using the RunMyProcess Javascript functions, update a collection, with some form inputs and the URLs of the uploaded files. The goal is to create a CRUD page to register some information on the application, so the users can use these information created on their processes. 

So, when the user fills this page´s form, and upload some files, he will hit the "save" button, and, using javascript, the application saves the information on a collection. After that, the whole form needs to be cleared so the user can input new information. So, each time the form is filled and saved, the application associates the uploaded files with the input information at the collection.

Is this somewhat clear now?

Thanks,

Eduardo




   





--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to a topic in the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/88zJYm3oo1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/CAMGV9zv6yTOM8PN6-tUiwHX2%2Bu%2BefzEUcRxYz8toJjsMR4Kscg%40mail.gmail.com.





Bidisha Das

unread,
Mar 6, 2015, 3:22:03 PM3/6/15
to suppor...@runmyprocess.com
Hi,
So basically you need a js function that can refresh the page after saving so that you don't have to manually go and refresh the page for every new entry? 
If this is your requirement,then the easy way to empty all the fields of your form would be to reload the page. In this case, just add window.location.reload(); in the body of the function which is called on success after inserting in collection.
You can also reset the fields if you want using widgetID.reset(); function.

Please let me know if I have misunderstood your question.


Thanks & Regards
Bidisha


cpspo...@gmail.com

unread,
May 28, 2015, 8:51:28 AM5/28/15
to suppor...@runmyprocess.com
Greetings Bidisha,

I have a similar situation to Eduardo. I have a looping process with a file upload widget that needs to be reset at the end of each loop. I think the widgetID.reset() is the function I need to utilize, however I am unsure how to implement it in a process step. I would like to include this as an input variable for a process step. Could you please assist?

Thank You,
Chris

Pankaj Kumar

unread,
May 31, 2015, 8:46:02 PM5/31/15
to suppor...@runmyprocess.com, cpspo...@gmail.com
Hi Chris,

file upload widget do not support the reset() method. by resetting the file upload widget, are you trying to hide the details of previously uploaded file in looping process? (attached screen print), kindly confirm.


Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
6462.png

cpspo...@gmail.com

unread,
Jun 1, 2015, 12:40:15 PM6/1/15
to suppor...@runmyprocess.com, cpspo...@gmail.com
Pankaj,

Yes, I am trying to hide the previously uploaded file in the widget display and to empty the variable associated with the file upload widget. I reference file_upload_variable[0] in my process, so having the looping process advance this index will cause errors in my process.

Chris

Bidisha Das

unread,
Jun 2, 2015, 10:01:23 AM6/2/15
to suppor...@runmyprocess.com
Hi,
You can try with ${detach_file(file_variable, instance_id)} in the Input/Output variables variable of your activities.It will remove the file from the widget but the file would be existing in the application in the RMP Server.


Thanks & Regards
Bidisha

cpspo...@gmail.com

unread,
Jun 2, 2015, 11:49:58 AM6/2/15
to suppor...@runmyprocess.com
Hi Bidisha,

That works well. Thank you for your help.

Chris
Reply all
Reply to author
Forward
0 new messages