PDA

View Full Version : [CLOSED] FileUploadField ClearOnSubmit



cwolcott
Jan 28, 2014, 2:28 PM
Using the example FileUploadField (http://examples2.ext.net/#/Form/FileUploadField/Basic/) how would you clear the Photo: field after pressing the save button?

I am looking at the "Form Example" section of the example. I have tried several things and must be missing something.

Daniil
Jan 28, 2014, 3:42 PM
Hi Chris,

Are you reporting that the ClearOnSubmit property doesn't work? Or just asking a way to clear it manually by JavaScript? If the second, please use:

App.FileUploadField1.reset();

cwolcott
Jan 29, 2014, 1:28 AM
Great. To clear out the TextField and FileUploadField contents I added the following line

Success="App.BasicForm.reset();"

to the SaveButton



<ext:Button ID="SaveButton" runat="server" Text="Save" Disabled="true">
<DirectEvents>
<Click OnEvent="UploadClick"
Before="if (!#{BasicForm}.getForm().isValid()) { return false; }
Ext.Msg.wait('Uploading your photo...', 'Uploading');"
Success="App.BasicForm.reset();"
Failure="Ext.Msg.show({
title : 'Error',
msg : 'Error during uploading',
minWidth: 200,
modal : true,
icon : Ext.Msg.ERROR,
buttons : Ext.Msg.OK
});">
</Click>
</DirectEvents>
</ext:Button>

Daniil
Jan 29, 2014, 4:41 AM
OK.

Please clarify is ClearOnSubmit not suitable for you?