2 Replies Latest reply on Apr 3, 2009 12:50 AM by dsailer.d.sailer.comcast.net

    image display help

    dsailer.d.sailer.comcast.net

      I'm trying to display some images (off the file system) in a dataTable. From what I can tell I need to pass a java.io.File to s:graphicImage so I have a bean to handle that:


      @Name("photoBean")
      @Scope(ScopeType.APPLICATION)
      public class PhotoBean {
        
        @Logger
        private Log logger;
        private String photoPathRootDirectory;
        
        public String getTestThis(String tst) {
          return "blahblah";
        }
      
        public void setPhotoPathRootDirectory(String photoPathRootDirectory) {
          this.photoPathRootDirectory = photoPathRootDirectory;
        }
      
        public String getPhotoPathRootDirectory() {
          return photoPathRootDirectory;
        }
        
        public String getPhotoFullPath(String filename) {
          return photoPathRootDirectory + filename;
        }
        
        public File getPhotoFile(String filename) {
          return new File(getPhotoFullPath(filename));
        }
      }
      



      and the view is:


             <rich:dataTable value="#{hubbleHome.adPhotos}"
                             var="_hubblePhoto"
                              id="adPhotosTable"
                  <rich:column>
                      <f:facet name="header">Photo Path</f:facet>
                      <h:outputText value="#{_hubblePhoto.filename}"/>
                  </rich:column>   
                  <rich:column>
                     <ui:define name="label">Photo</ui:define>
                     <s:graphicImage value="#{photoBean.photoFile(_hubblePhoto.filename)}"/>
                  </rich:column> 
      



      with s:link you can pass a parameter in an EL expression but I guess you can't do that with s:graphicImage (I get method not found). So how would I do this?