Julie
Julie

Reputation: 189

Webflow's flow scope and making primefaces graphicImage work

I am using a spring bean with flow scope which has a primesfaces's StreamedContent field and the image does not show up. Any ideas on how to make this work with flow scope? It works fine when it is a managed bean with request scope and also when it is a spring bean with session/prototype/singleton scope.

Below is some sample code:

flow:

 <input name="springBean" required="false"/> 

 <view-state id="testFlow">
     <transition on="post" to="testFlow" />
 </view-state>

xhtml file:

<ui:define name="body">
<h:form>
    <p:graphicImage value="#{springBean.barcode}" cache="false"/>
    <br /> 
    <h:outputText value="This is a test flow" />
    <br />
    Message From Spring = #{springBean.text}<br />
    <h:inputText value="#{springBean.text}" style="width:200px" />
    <h:commandButton action="post" value="Update" />
</h:form>
</ui:define>

application context:

<import resource="flowConfig.xml" /> 

<bean name="springBean" class="swfproject.MessageHolder" scope="flow">
    <property name="text" value="This was defined in Spring" />
</bean>

Upvotes: 2

Views: 755

Answers (1)

rootkit
rootkit

Reputation: 2165

The only way I have found so far is to extend GraphicImage component and make it store binary content in the Session. See How to make Primefaces graphicImage work with Spring Web Flow

Upvotes: 0

Related Questions