0 Replies Latest reply on Dec 16, 2008 7:55 PM by Mike Jones

    s:graphicImage graphicImageStore question

    Mike Jones Newbie

      Hello. Can somebody please tell me if what I'm attempting to do incorrect?

      I'm attempting to use seam's graphicImage tag to display a bunch of jpeg images that are, you guessed it, loaded from the database. I do not have a backing bean for the results I'm pulling from the database, so I can't follow what the seambay example shows, because the data columns are not known prior.

      Instead, I have a map of unique image names and their respective byte array values that are populated in a SFSB conversation scoped manager.

      This is how the map on the manager is declared:

      @Out(required = false, value = "theImages", scope = ScopeType.CONVERSATION)
      private Map<String, byte[]> images;

      And the page snippet that attempts to load these looks like this:

      <s:graphicImage id="#{row}_#{column}" value="#{theImages['#{row}_#{column}']}" fileName="#{row}_#{column}">

      Needless to say, I see red x marks instead of images, so I'm not sure what I'm missing.

      What I did come across in the server log is the following:

      13:43:44,984 DEBUG [BaseXMLFilter] create HTML/XML parser for content type: null
      13:43:44,985 DEBUG [BaseFilter] Finished request processing total time 11ms for uri: /pilot/seam/resource/graphicImage/1_0.png
      13:43:44,988 DEBUG [AjaxPhaseListener] Process before phase RESTORE_VIEW 1
      13:43:44,992 DEBUG [AjaxPhaseListener] Process after phase RESTORE_VIEW 1
      13:43:44,996 DEBUG [AjaxPhaseListener] Process before phase RENDER_RESPONSE 6

      Now, the name of one of the images is "1_0" , but I do not see what is adding the .png to the end.
      It seems like the map is getting nulled out before the response is rendered.

      Maybe if you can please tell me where the graphicImageStore gets its images from? Is there a way to hand it my map? Is my scoping of the map incorrect?

      What am I missing?

      Thanks a bunch in advance for your time.