5 Replies Latest reply on Jul 13, 2010 9:44 PM by shane lee

    S:fileupload , "accept"  attribute is not working

    Aboo salimon Newbie
      Hi,

      i am using....s:fileupload but this is not working properly with accept attrinute , it is accepting all formats..... see this code... where i done mistake...




      <h:form id="customizeform" enctype="multipart/form-data">
             
                <h6>Provider logo and picture</h6>
                <h:panelGrid columns="3" id="imagesIDpanel">
                
                     <h:panelGroup>
                          <h:panelGroup layout="block" styleClass="provider-picture">
                               <h:graphicImage value="/#{utilities.getImage(customizeManager.getCurrentProviderLogo())}" width="150" height="65" rendered="#{customizeManager.getCurrentProviderLogo() != null}"/>
                          </h:panelGroup><br/>
                          <h:panelGroup>
                               <span class="providerorg">Upload your logo</span><br/>
                               <s:fileUpload id="uploadFieldLogo"
                                    data="#{logo.data}"
                                    fileName="#{logo.name}"
                                    fileSize="#{logo.size}" styleClass="bigButton"
                                    accept="images/png,images/jpeg,images/jpg,images/bmp" />
                          </h:panelGroup>
                          <br/>
                          <br/>
                     </h:panelGroup>
                     <rich:spacer width="30"/>
                     <br/>
                     
                     <h:panelGroup>
                          <h:panelGroup layout="block" styleClass="provider-picture">
                               <h:graphicImage width="178" height="96" value="/#{utilities.getImage(customizeManager.getCurrentProviderPicture())}" rendered="#{customizeManager.getCurrentProviderPicture() != null}"/>
                          </h:panelGroup><br/>
                          <h:panelGroup>
                               <span class="providerorg">Upload your picture</span><br/>
                               <s:fileUpload id="uploadFieldPicture"
                                    data="#{picture.data}"
                                    fileName="#{picture.name}"
                                    fileSize="#{picture.size}"
                                    accept="image/png,image/jpeg,image/jpg,image/bmp" />
                               </h:panelGroup>
                     </h:panelGroup>
                     <br/>
                     
                </h:panelGrid>
                <br/>
                <span class="providerorg"><h:outputText value="* Accepted Images Types are *.jpeg,*.bmp and *.png "/>     </span>
                <br/><br/>
                
                <h6>Themes</h6>
                <h:panelGrid rows="1" columns="1" width="70%">
                     <h:selectOneRadio styleClass="radioStandardwht"  value="#{customizeManager.providerParamsMap.THEME}" required="true" layout="pageDirection">
                          <f:selectItem itemValue="theme_1.css" itemLabel="eZee Darkness"/>
                          <f:selectItem itemValue="theme_2.css" itemLabel="eZee Nature"/>
                          <f:selectItem itemValue="theme_3.css" itemLabel="eZee Aqua"/>
                     </h:selectOneRadio>
                </h:panelGrid>
                <br/><br/>
                <h:panelGroup>
                     
                </h:panelGroup><h:commandButton value="Save modifications" render="imagesIDpanel" rendered="#{s:hasPermission('LookAndFeel','Edit')}" action="#{customizeManager.saveOptions()}" styleClass="bigButton" />
           </h:form>