I am using oracle 12c. I have a form where i have 3 input fields and one af:inputFile where i need to upload the file and final save.
I cannot use valueChangeEvent for inputFile because if i user ResetUtils then i will not get the form input values.
On save everything works fine but when i again add a record then the last updated file still shows in inputFile(its not resetting).
After save if i set the input file binding to null then do partial trigger for the component using binding its loading the page taking huge time to save so i cant use it.
Here is my code
<af:panelFormLayout id="pfl1" rows="3">
<af:inputText value="#{bindings.Filename.inputValue}" label="#{bindings.Filename.hints.label}"
required="#{bindings.Filename.hints.mandatory}"
columns="#{bindings.Filename.hints.displayWidth}"
maximumLength="#{bindings.Filename.hints.precision}"
shortDesc="#{bindings.Filename.hints.tooltip}" id="it9"
contentStyle="width:150px" showRequired="true">
<f:validator binding="#{bindings.Filename.validator}"/>
</af:inputText>
<af:panelGroupLayout id="pgl350" layout="horizontal">
<af:inputFile label="Select" id="if51" value="#{ContractDocumentUploadDwn.file}"
showRequired="true" binding="#{ContractDocumentUploadDwn.inputFileBinding}"/>
<af:button text="Upload" id="b353" action="#{ContractDocumentUploadDwn.uploadPortfolioDoc}"/>
</af:panelGroupLayout>
</af:panelFormLayout>
Java Code:
public void savePortfolioDoc(ActionEvent actionEvent) {
// Add event code here...
DCIteratorBinding iter = getDCIteratorBinding("portfolioDocument1Iterator");
UploadedFile myfile = (UploadedFile) this.getInputFileBinding().getValue();
String binding = "Commit1";
String popUpId = "p2";
genericSaveDocuments(actionEvent, iter, myfile, binding, popUpId, "Portfolio");//Saves the document
iter.executeQuery();
iter.refresh(1);
setInputFileBinding(null);
ResetUtils.reset(actionEvent.getComponent());
}
Please Help Me