[ 
https://issues.apache.org/jira/browse/DELTASPIKE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14565574#comment-14565574
 ] 

Nuno G. de M commented on DELTASPIKE-914:
-----------------------------------------

Hi Thomas,
And thank you for your reply and added information.

I've added some feedback on the prime-faces issue, where In my opinion, I 
believe that primefaces should be able to re-design the way its renderer works 
together with its resource handler to be able to always accomplish finding out 
the stream content, regardless of the value expression / bean nature that is in 
the index.xhtml ... since for a brief moment in time, the render has in its 
hand the content that it will need to stream in the next request.
You might disagree with the suggestion though, but I belive its feasible.

I would also not disagree that perhaps DeltaSpike - assuming that there is a 
way - and judging by the code snipped you-ve placed above there is - to 
activate the windowContext for an inbound request, even if its ResourceHandler 
based.

In my opinion, for any request that is JSF related, if you are using 
deltaspike, it would be good if the contexts it manages would be active.

To me, potentially, on both sides of the equation something could be done that 
would address the issue.

Many thanks.

> Rendering a dynamic p:graphicImage whose StreamConent is in a Deltaspike 
> ViewScoped bean seems not to work
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: DELTASPIKE-914
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-914
>             Project: DeltaSpike
>          Issue Type: Bug
>          Components: JSF-Module
>    Affects Versions: 1.4.0
>         Environment: All containers - tested on Weblogic 12.1.2 but the issue 
> is cross cuting
>            Reporter: Nuno G. de M
>            Assignee: Thomas Andraschko
>              Labels: graphicImage, primefaces, viewaccesscoped
>
> Hi,
> This issue has to do with incompatibility between primefaces p:graphicImage 
> and deltaSpike ViewAccessScoped beans.
> The prime faces graphic image apperently has two core modes of rendering an 
> html <img> component. On one mode it will generate a resource to a statically 
> available image. 
> Under this scenario we have no problems even when workign with a 
> ViewAccessScoped bean to provide the img resource path.
> Such as:
>  <h:panelGroup layout="block">
>                     <h:outputText value="As resource determined from 
> viewSopecedBean: " />                                        
>                     <br/>
>                     <br/>
>                     <p:graphicImage id="previewImageB"  
> value="#{resource[viewScopeadBean.imageResource]}"  width="250px" 
> height="250px" rendered="true" />
>                 </h:panelGroup>
> However, when rendering dynamic content, ViewAccess scoped beans are not 
> compatible, as the primefaces dynamic content handler tries to evaluate a 
> ValueExpression and the ViewScopedBean context appears not to be active.
> <h:panelGroup layout="block">
>                     <h:outputText value="As dynamicRsource determined 
> fromViewScopedBean: " />                                        
>                     <br/>
>                     <br/>
>                     <p:graphicImage id="previewImageC"  
> value="#{viewScopeadBean.streamedContent}"  width="250px" height="250px" 
> rendered="true" />
>                     
>                     <br/>
>                     <p> Ok and here we have our bug. 
>                         The problem we have here seems to be that 
> PrimeResourceHandler and the GraphicImageRenderer work together without 
> problems with deltaspike when dealing with static content. 
>                         However, when we are dealing with dynaminc content 
> set on page bean
>                         the Renderer will tune the session context with the 
> expression language of the .xhtml page so when the browser asks for the img 
> src,                         
>                         PrimeResourceHandler will be able to discover what EL 
> was associated to that img resource
>                         and resolve on the fly the dynamic content asked by 
> the user.
>                         However, the view access scoped seems not be 
> available for PrimeFaces so he comes out empty handed.
>                     </p>
>                 </h:panelGroup>
> I have written a small sample application that renders the image of a 
> labrador using both flavors (static resource and dynamic resource).
> https://github.com/99sono/delta-spike-dynamic-content_issue
> https://github.com/99sono/delta-spike-dynamic-content_issue/blob/master/src/main/resources/BugOverview.docx
> I am not sure if a bug should not be opened as well to primefaces, since it 
> looks to me that addressing this issue will most likely require coordination 
> on both teams.
> The only work-around for this seems to be to re-factor code to use request 
> scoped beans or session scoped beans.
> Or if geting view scoped beans to work together with this component is really 
> a must, which in our case it is....
> We will have to come-up with a temporary hack to the
> p:graphicImage renderer and to the PrimeResourceHandler to be able to somehow 
> bypass the fact that ViewAccess scope is not available.
> I really do not wish to go down this path  - more than temporarily.
> Thank you for your support,
> Kindest regards,
> Nuno.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to