4 Replies Latest reply on Mar 9, 2011 6:34 AM by yirco

    richfaces-4.0.0.20110209-M6 - fileUpload - some attributes ignored

    yirco Newbie

      Hi,

       

      I tried to set some attributes of the fileUpload element. The example comes from RichFaces Show Case in richfaces-4.0.0.M6.zip.

       

      The fileUpload component renders but ignores some attributes, i.e. they have no effect on the rendered page.

       

      For example even if maxFilesQuantity="1" I can add more files. listWidth="300px" does not change the width of the list. addControlLabel="Something" does not change the text of the add label.

       

      acceptedTypes and noDuplicate are considered and they are in the JS in the rendered page:

       

      new RichFaces.ui.FileUpload("j_idt34:upload",{"acceptedTypes":"jpg, gif, png, bmp","noDuplicate":true} );

       

      There is no exception in the server log. Only this warning:

       

      WARNING: JSF1091: No mime type could be found for file org.richfaces.renderkit.html.images.ButtonHoverBackgroundImage.  To resolve this, add a mime-type mapping to the applications web.xml.

      WARNING: JSF1064: Unable to find or serve resource, org.richfaces.renderkit.html.images.ButtonHoverBackgroundImage.

       

      Could anyone please tell me what the problem is?

       

      Thank you.

       

      richfaces-4.0.0.20110209-M6

      Servers: GlassFish 3.1, JBoss jboss-6.0.0.Final

      Browsers: SeaMonkey 2.0.12, MS IE 8, Google Chrome 9.0.597.107

       

      libraries:

      cssparser-0.9.5.jar

      guava-r08.jar

      sac-1.3.jar

      richfaces-components-api-4.0.0.20110209-M6.jar

      richfaces-components-ui-4.0.0.20110209-M6.jar

      richfaces-core-api-4.0.0.20110209-M6.jar

      richfaces-core-impl-4.0.0.20110209-M6.jar

       

       

      <html xmlns="http://www.w3.org/1999/xhtml"

          xmlns:h="http://java.sun.com/jsf/html"

          xmlns:ui="http://java.sun.com/jsf/facelets"

          xmlns:f="http://java.sun.com/jsf/core"

          xmlns:rich="http://richfaces.org/rich">

       

       

          <rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"

                id="upload" acceptedTypes="jpg, gif, png, bmp" maxFilesQuantity="1" addControlLabel="Something" noDuplicate="true" listWidth="300px">

                <a4j:ajax event="uploadcomplete" execute="@none" render="info" />

            </rich:fileUpload>