[ 
https://issues.apache.org/jira/browse/TRINIDAD-1564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750806#action_12750806
 ] 

Andrew Robinson commented on TRINIDAD-1564:
-------------------------------------------

I doubt this is a bug. The page flow scope only relates to the current view 
root, but you are trying to access it in a constructor. I would suggest trying 
to instantiate the objects in an action method, a get method or in a phase 
listener attached to the view root. When you put it in a constructor, you 
cannot be sure what view that pageFlowScope is being assigned to, especially 
when your backing bean is request scope, which can span two views.

> pageFlowScope values set in the constructor of a managedbean is not getting 
> retained
> ------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1564
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1564
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>         Environment: windows xp
>            Reporter: Vijay Ramalingam
>
> Hi
> I have a xhtml as below. In the constructor of the managedbean, i set a value 
> in the pageFlowScope. But after the form is submiited, i do not find the 
> value in the pageFlowScope. Please help or advise.
> My XHTML
> --------------------------------------------------------------------------------
> <f:view>
> <h:form id="testPageFlowScope">
> <br></br>
> <h:inputText id="selectState" value="#{pageFlowScope.state}" required="true" 
> requiredMessage="State is mandatory" >
> </h:inputText>
> <br></br>
> <h:commandButton id="testPageFlowScope" value="Test PFS" 
> action="#{amaConfig.testPageFlowScope}">
> </h:commandButton>
> <h:outputText value="#{testPFS.country}"/>
> </h:form>
> </f:view>
> My managed-bean declaration in faces-config
> --------------------------------------------------------------------------------
> <managed-bean>
> <managed-bean-name>testPFS</managed-bean-name>
> <managed-bean-class>xyz.TestPageFlowScope</managed-bean-class>
> <managed-bean-scope>request</managed-bean-scope>
> </managed-bean>
> My Bean
> --------------------------------------------------------------------------------
> public class TestPageFlowScope extends ManagedBase {
> public TestPageFlowScope() {
> super();
> RequestContext requestContext = RequestContext.getCurrentInstance();
> Map pageFlowScope = requestContext.getPageFlowScope(); 
> pageFlowScope.put("state", "India");
> }
> public String getCountry(){
> return "India";
> }
> }
> Once i submit the form, i check the pageFlowScope map....but it doesn't have 
> any values. Please help
> PageFlowScope : pageflowscope...@6298797[_map={}, _token=null,_children=null]
> Thanks
> -vijay 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to