werpu commented on PR #356:
URL: https://github.com/apache/myfaces/pull/356#issuecomment-1311425893

   > Also I tested the file upload and the single upload via ajax is working 
now. However, the multiple file is not? I only saw one file encoded.
   
   Works in my testcase:
   ```html
    <h:form id="testForm" type="multipart/form-data" 
enctype="multipart/form-data">
               <h:inputFile id="bla" value="#{fileupload.uploaded}">
               </h:inputFile>
               <h:inputFile id="bla3" value="#{fileupload.uploaded2}">
               </h:inputFile>
               <h:commandLink id="bla2" value="Upload" 
action="#{fileupload.doUpload}" type="button">
                   <f:ajax execute="@form" render="successfield" />
               </h:commandLink>
               <h:outputText id="successfield" 
value="#{fileupload.msg}"></h:outputText>
           </h:form>
   ```
   
   ```java
   @Named
   @RequestScoped
   public class Fileupload {
   
       private Part uploaded;
       private Part uploaded2;
     
       private String msg = "";
       
       public String getMsg() {
           return msg;
       }
   
       public void setMsg(String msg) {
           this.msg = msg;
       }
   
       public void doUpload() {
           if(uploaded != null && uploaded2 != null) {
               msg = "success";
           }
       }
   ...
   
   
   <img width="789" alt="image" 
src="https://user-images.githubusercontent.com/530547/201306063-16ea533a-9d10-4597-bc84-85e1c735e7fd.png";>
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to