Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to reset ADF input File component

How to reset ADF input File component

In this section, we walk through how to Reset Adf File component ad:inputFile

1. Here below is the JSF page



            
            


        

2. Here below is the actionListener method of the backing bean class. This resets the component

private RichInputFile if1;
.....

     public String processFileUpload() {
     
            UploadedFile file = this.getFile();
            ......
            //The below lines will reset the af:inputFile component. 
           
            this.getIf1().resetValue();
            this.setF1(null);
            this.getIf1().setValid(true);
....
....
            
            FacesMessage Message = new FacesMessage("File Saved Successfully!");   
            Message.setSeverity(FacesMessage.SEVERITY_INFO);   
            FacesContext fc = FacesContext.getCurrentInstance();   
            fc.addMessage(null, Message);
            // Add event code here...
            return null;
        }

3. This is how the page looks like. The File Upload comes back to the same state



This post first appeared on Oracle ADF, BPM, BI And Primavera P6 Tutorials, please read the originial post: here

Share the post

How to reset ADF input File component

×

Subscribe to Oracle Adf, Bpm, Bi And Primavera P6 Tutorials

Get updates delivered right to your inbox!

Thank you for your subscription

×