Pageflow-scoped bean "disappearing" during postbacks

Hello,
I'm getting crazy with an error with a pageflow-scoped bean which suddenly "disappers"...
What I need to do is to use a bean to mantain the visibility status of 2 components (one is visible while the other isn't), an edit form and a warning message:
  <af:outputText value="some warning text"
                 visible="#{!pageFlowScope.untitled1.editFormViewable}"/>
  <af:panelFormLayout visible="#{pageFlowScope.untitled1.editFormViewable}">
  </af:panelFormLayout>the editFormViewable boolean variable is updated within the selectionListener of a tree (which also resides in the same bean), according to the node
selected by the user:
public class Untitled1Bean implements Serializable {
  private Boolean editFormViewable;
  public Untitled1Bean() { }
  public void treeSelectionListener(SelectionEvent event) {
    // manipulates editFormViewable
}so I either show the form or the warning message. I need to retain editFormViewable across requests so backingBean scope isn't fully appropriate, but I'm also in a bounded taskflow so according to the guide viewscope is not supported. So I went for pageFlow scope.
Here's the definition for the managed bean in my bounded taskflow:
    <managed-bean>
      <managed-bean-name>untitled1</managed-bean-name>
      <managed-bean-class>test.view.backing.Untitled1Bean</managed-bean-class>
      <managed-bean-scope>pageFlow</managed-bean-scope>
      <managed-property>
        <property-name>editFormViewable</property-name>
        <property-class>java.lang.Boolean</property-class>
        <value>false</value>
      </managed-property>
    </managed-bean>Now, when I enter the taskflow and load the page everything is fine, editFormViewable is correctly initialized to false (same if I set it to true) and the page displays correctly.
However, as soon as I expand a node of the tree to access its children, my app dies with the following exception:
javax.el.PropertyNotFoundException: Target Unreachable, 'untitled1' returned null
     at com.sun.el.parser.AstValue.getTarget(AstValue.java:88)
     at com.sun.el.parser.AstValue.invoke(AstValue.java:153)
     at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
     at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1264)
     at org.apache.myfaces.trinidad.component.HierarchyUtils.__handleBroadcast(HierarchyUtils.java:81)
     at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:227)
     at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:220)
     at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:153)
     at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:231)
     at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:220)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:754)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:282)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
     at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
     ...So it seems that during postbacks on that page the managed bean is no longer accessibile? How can a pageFlow bean disappear at that point? The bounded taskflow only has a view activity with my page, I'm in, why is the bean getting instanced correctly and then lost?
Can someone please shed some light on this? I've used beans with scope longer than backing bean before, but never encountered such a problem.

Sorry but that can't be right, probably just a leftover from previous versions or a mistake in the doc.
JDeveloper itself on the "Managed Beans" tab of any taskflow, when registering a managed bean, presents you with a combobox offering 7 choices including pageFlow scope.
Why would JDeveloper offer a non-existant feature in its UI?
Also, I've used and seen them before. Check custRegBasicInformationBean, custRegDefineAddressesBean and welcomeUserRegistrationBean in FOD, they're pageflow-scoped beans and they do work.
Mine works too, except that it breaks completely on postbacks from a tree.

Similar Messages

  • PLZ Help: how to get value of a request scoped Bean/Attribute in JSF ?!!!

    hi,
    I noticed this part of code to retrieve session scoped beans/vars in an ActionListener or other jsf classes, but it does not work for request scoped beans/vars :( what's the problem then ? what shall i do ?
    Type var = (Type)Util.getValueBinding("myBeanInRequest")).getValue(context);
    I have also set that getPhaseId() returns UPDATE_MODEL_VALUES or APPLY_REQUEST_VALUES.
    Any comment or idea ?

    I have declared my Bean in my JSP page not in the
    faces-config.xml. Does this make any problem ? Also I
    have tried the way you told me as well, but still the
    returned attribute is null.
    P.S. My bean is declared in my JSP page this way:
    <jsp:useBean id="newSurveyVar" class="SurveyModel"
    scope="request" />
    This declaration causes the SurveyModel instance to be created in request scope when the page is rendered, but that doesn't help you when the form is submitted -- that is going to happen on the next request (so the request attribute created here goes away). Basically, <jsp:useBean> is not typically going to be useful for request scope attributes (it's ok for session or application scope, though).
    and further I have this jsf code:
    <h:command_button label="Create" commandName="create"
    action="create" >
    <f:action_listener
    r type="CreateNewSurveyActionListener"/>
    </h:command_button>
    and this is my
    CreateNewSurveyActionListener.processAction(ActionEvent
    e) {
    if (actionCommand.equals("create_the_survey")) {
    FacesContext context =
    t = FacesContext.getCurrentInstance();
    SurveyModel survey =
    y =
    (SurveyModel)(Util.getValueBinding("newSurveyVar")).get
    alue(context);
    if (survey==null) // returns true :(((
    And since I've declared my beans here there is nothing
    special declared in my faces-config.xml
    For me again it is really strange why it is not
    working !!!
    Any idea ? Because the event listener is fired in a separate request, so the one you created in the page is gone.
    This is why the managed bean creation facility was created. If your component contains a valueRef that points at the bean name (or you evaluate a ValueBinding as illustrated earlier in the responses to your question), then the bean will get instantiated during the processing of the form submit.
    Craig McClanahan

  • Reentrant lock with Orchestra conversation scoped bean on second AJax call

    I'm just trying to set us a fairly straightforward JSF 2.0 / Spring / PrimeFaces application. Since backing bean expiry has been such a nuisance I thought I'd give Orchestra's conversation scope mechaniism a go.
    the problem I'm getting seems to occur on the second Ajax transaction for the page.
    WARNING: Waited for longer than 30000 milliseconds for access to lock org.apache.myfaces.orchestra.lib._ReentrantLock@2e8da6a9 which is locked by thread http-8084-5
    22-Mar-2011 11:16:13 org.apache.myfaces.orchestra.lib._ReentrantLock lockInterruptiblyThis message repeats, and the Ajax transaction never returns.
    I know that Orchestra locks the coversation scoped beans during the processing of a transaction to avoid threading issues (since they may contain non-reentrant objects like EntityMangers etc.) I'm assuming that, somehow, the backing bean is not unlocked at the end of the first Ajax transaction. But the configuration of listeners etc. should be being done automatically.
    Anyone tried a combination like this?

    never even heard of it. If I'd need a conversation scope (and I rarely do), I'd go for Seam 3 in stead even if it is not final yet.

  • When exactly are request-scoped beans evicted from memory?

    Hi,
    I have a question about request-scoped JSF-managed beans and request-scoped HibernateFilter. It seems to me that request-scoped JSF beans actually outlive an HTTP request. Here's what I mean. Let's say I have a page backed by a request-scoped bean #{myBean} which displays a dataTable. a user can click on a row to perform some operation on row data.
    I always thought the following to be true about lifecycle of JSF request-scoped bean:
    1.User makes initial page request
    -HTTP Request 1 (R1) comes in
         1. RestoreView encounters #{myBean} in page and constructs MyBean
         2. RenderResponse renders the page
    -R1 is terminated, page is displayed, myBean is evicted from memory
    2.User looks at the dataTable and clicks on a specific row (via commandLink). Now MyBean.action() is supposed to be
    executed and perform some operation on row data:
    -HTTP R2 comes in
         1.MyBean is constructed again (e.g. not using same instance as in R1). (THIS IS KEY!)
         2.myBean.action() is executed
    -R2 is terminated, myBean is again evicted from memory
    Is the above understanding correct?
    Or does myBean instance (and its' properties) remain in appserver memory between R1 and R2 and R2 actually uses the
    same instance of myBean?
    If scenario above is correct, then I have a strange problem:
    -when performing myBean.action() during R2 on rowData (which is instance of MyHibernateBean) I get a
    HibernateException stating that bean isn't associated with a Hibernate Session. This can only happen if the lifecycle of the object and its' parent myBean exceeded that of R1. That is because I have a Hibernate Servlet
    Filter that a) start a Hibernate Transaction on incoming request and b) commits it on the way out.
    Here's pseudo-code for myBean:
    public class MyBean {
        public static String HANDLE = "#{myBean}";
        //getters setters omitted
        //used as 'value' in dataTable
        private List<MyHibernateBean> dataBeans;
        //dataTable binding
        private UIData tableData;
        public MyBean() {
        public String action() {
            //read children & modify state of a hibernate bean
            MyHibernateBean dataBean = (MyHibernateBean) this.tableData.getRowData();
            HibernateUtil.getCurrentSession().refresh(dataBean); //seems necessary as dataBean instance deemed 'stale'
            dataBean.getChildCollection(); //will fail without line above
            return "toSomewhereElse";
    }

    By the way, I have an hypothesis why this does not work...
    The datatable values MUST be specified using a value binding expression. When the restoreState method for the component is called, JSF attempts to use the VB expression to get the table values. When the managed bean is not found, it creates a new (empty) one and the world ends (actually it just returns back to the original page because it cannot figure out what to do)

  • Creative cloud installer just disappears during install

    I had creative cloud and on last update most of the applications are gone along with the desktop icon.
    I have tried to install creative cloud again - but it just stops halfway and disappears during install.
    I've tried safe mode install
    Ive renamed OOBE folders in both librarys
    I've tried the adobe application manager and that crashes on install
    I've tried the Adobe clean up tool
    Nothing is working to get creative cloud to reinstall on the computer - I've lost about 4 applications in creative cloud
    Working on a Mac - Yosemite OS

    Hi!  The cleaner failed - simply could not detect any creative cloud products. ( It did find a previous CS6 installation, long since uninstalled, actually).
    Didn't get a chance to try ROOT, as an Adobe tech (Loveneesh) remoted in and did some 'known fixes'... basically he cleaned up the failed CC desktop installation ( deleted a couple of folders) - and then gave "wide open" permissions to a couple of sets of library folders ( One for machine, and one for user). I believe they were
    /library/application support/
    /library/application support/Adobe/
    /users/[username]/library/application support/
    /users/[username]/library/application support/Adobe/
    Still couldn't install CC desktop, (failed twice!) BUT that at least allowed  the installation of "Adobe App Manager" - which was subsequently UPGRADED to CC Desktop. Something of a clever workaround, if you ask me!
    And now its all working OK again.
    I'm a bit bothered by the somewhat cavalier ""Everybody" permissions applied to library folders, but as I understand this is the quick fix when nobody quite knows what the heck is going on with permissions... (I suppose ROOT access gives much the same effect for installations)

  • HELP! Does anyone know a "Data Recovery Expert" for I-Phone? - My calender disappeared during transfer of data from my old I-Phone 4 to my new I-Phone 5s. It was on both I-Phones then vanished. (It was evidently not syncing during back-ups on the laptop)

    HELP! Does anyone know a "Data Recovery Expert" for I-Phone? - My calender disappeared during transfer of data from my old I-Phone 4 to my new I-Phone 5s. It was on both I-Phones then vanished. (It was evidently not syncing during back-ups on the laptop)

    What calendar were you syning to? Outlook? Google? Something else? The directions on how to resync vary a bit.

  • HELP! Does anyone know a Data Recovery Expert for I-CIoud? -My calender disappeared during I-Cloud transfer of data from old I-Phone 4 to new I-Phone 5s. It was on both I-Phones then vanished. (It was evidently not syncing during back-ups on the laptop)

    HELP! Does anyone know a "Data Recovery Expert" for I-Cloud & I-Phone? - My calender disappeared during I-Cloud transfer of data from my old I-Phone 4 to my new I-Phone 5s. It was on both I-Phones then vanished. (It was evidently not syncing during back-ups on the laptop)

    HELP! Does anyone know a "Data Recovery Expert" for I-Cloud & I-Phone? - My calendar disappeared during I-Cloud transfer of data from my old I-Phone 4 to my new I-Phone 5s. It was on both I-Phones then vanished. (It was evidently not syncing during back-ups on the laptop)
    The Apple techs are looking. But they can't find it. Nor can they find a back up on my laptop, Evidently when I backed up my Iphone to computer the calendar wasn't syncing. Since I only use the calander on my phone - I never noticed.
    The Apple store rep that sold me the I-Phone 5 on Monday, was transferring my contacts and calendar thru I-Cloud (I never used I-Cloud before that moment - and always had it turned off). He successfully transferred the contacts - which are still on my phone), but the Calendar weirdly split into 6 calendars (2 of which were linked to my G-Mail which only had a few entries) (4 were linked to my MSN / Hotmail email and contained all the major events/data). I never created calendars that were separate or liked them to 2 different emails. I just typed entries into the I-Phone calendar. However, the calendar did exist on the new I-Phone for 24 hours. Something happened during transfer. When the Apple Genius Bar tech was attempting to back up my Calendar & merge the 6 calendars, everything disappeared in his hand while he was looking at it.
    I am hoping that some really good data recovery expert exists that can restore the calendar that was in both I-Phones yesterday. It is completely devastating if I can't recover it.
    Any help, or referrals, is great appreciated!!!!
    Thanks!

  • Oracle-ADF inlineFrame initializing view scoped bean twice

    I am facing strange issue related with af:inlineFrame component. Trying to display/render ADF page inside of af:popup within af:inlineFrame component. The weird thing is when the popup displayed; view scoped bean's @PostConstruct method called twice. That means bean is initialized twice. However it needed to be initialized once since bean is referenced from the page that is going to be displayed inside af:inlineFrame.
    Correct flow gotta be:
    Click to button openPopup() method called.
    openPopup() sets URI then opens popup.
    inlineFrame source property set as it's going to display framePage.jspx.
    JSF scans framePage.jspx code finds out there is a reference to FrameBean inside af:outputLabel
    Construct FrameBean then call @PostConstruct method.
    Call appropriate getter and render page.
    What happens in my case:
    Click to button openPopup() method called.
    openPopup() sets URI opens popup.
    inlineFrame source property set as it's going to display framePage.jspx.
    JSF scans framePage.jspx code finds out there is a reference to FrameBean inside af:outputLabel
    Construct FrameBean then call @PostConstruct method.
    Call appropriate getter and render page.
    Construct FrameBean then call @PostConstruct method.
    Call appropriate getter and render page.
    Popup located like:
    <af:popup id="mainPopup" binding="#{mainBean.mainPopup}">
    <af:dialog id="mainDialog">
      <af:inlineFrame source="#{mainBean.URI}"> </af:inlineFrame>
      </af:dialog>
    </af:popup>
    Showing popup via af:button action="#{mainBean.openPopup}":
    public void openPopup() {
    this.setURI("http://localhost:7001/app/framePage.jspx");
      RichPopup.PopupHints hints = new RichPopup.PopupHints();
    this.getMainPopup().show(hints);
    framePage.jspx:
    <?xml version='1.0' encoding='UTF-8'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <jsp:directive.page contentType="text/html;charset=UTF-8" />
    <f:view>
    <af:document title="Frame Demo" id="demoDocument">
      <af:form id="demoForm">
    <af:outputLabel value="#{frameBean.commonId}">   </af:outputLabel>
      </af:form>
      </af:document>
    </f:view>
    </jsp:root>
    FrameBean:
    @ManagedBean
    @ViewScoped
    public class FrameBean {
    private String commonId;
      @PostConstruct
      public void afterInit() {  } 
      public String getCommonId() {
    return commonId;
    public void setCommonId(String commonId) {
    this.commonId = commonId;
    Making FrameBean @SessionScoped solves this issue since bean is kept with session but I don't want to keep it within session. Also setting source property of af:inlineFrame in jspx as hardcoded not fixing the problem.

    im using ADF Essential on Glassfish 3.1 with no problem, but glassfish is heavyweight. I think Oracle ADF is not dependent to Application Server , then i tried to use my project with Tomcat 7. I deployed my application on Tomcat 7 , but im getting some exceptions.
    Not all application servers support Oracle ADF.
    Refer the certification matrix, Tomcat 7 is not listed as being supported.
    http://www.oracle.com/technetwork/developer-tools/jdev/index-091111.html

  • IOS 7 ugrade failed " Error:Device disappeared during timed transition". Phone will not now turn on or sync with itunes, any ideas please?

    iOS 7 ugrade failed " Error:Device disappeared during timed transition". Phone will not now turn on or sync with itunes, any ideas please?

    if a Mac OSX Computer is in near - try iBackup Viewer.
    This is free of charge and can read your backup.
    and thats the main difference. Those tools are reading the saved Data in the backup
    but itunes attempts to restore the data from the backup on your iphone. if there are any corrupted data in the backup - the backup restore goes wrong. this can happen during security software or wrong corrupt data already stored on the iphone.
    if itunes messed up to restore from backup try this one :
    - restore your iphone to factory settings using HT1808 or reset all settings and content direct from iphone
    - rename your iPhone (e.g. iPhone Test)
    - setup your iPhone as new device -> attempt to make a new backup - if successful -
    - click in itunes on restore from backup... and choose your desired backup
    or go to:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    Windows XP: \Documents and Settings\(Username)\Application Data\Apple Computer\MobileSync\Backup\
    Windows Vista - Windows 7: \Users\(Username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    Pull your complete BackupFolder and try a different PC - copy the BackupFolder on this different PC in the same Path above - start iTunes and see if your Backup is there - attempt to restore from Backup again

  • Since upgrading to 6 on my iphone, my notes disappear. They are no longer in the cloud. Also disappear during typing! What's happening?

    Since upgrading to 6 on my iphone, my notes disappear. They are no longer in the cloud. Also disappear during typing! What's happening?

    So you have business contacts that were lost... do you not have these on a Database in some shape or form? Sounds like you need to invest in a RAID1 backup setup for your computer so you dont have this issue in the future.
    As for repairing your problem, sounds like you are going to need to start from scratch at this point or if the data is still on your phone look into a program that can take the information from the phone onto iTunes.

  • Using Query String Parameters with Session Scoped bean

    I would like to pass query string parameters from a product page (user clicks on a specific product commandLink) that is request scope to a details page that is session scoped.
    The problem is that the session scoped page only handles the first request. If you view the details of a product and then navigate back to the product page and choose another product ... the details page will not handle the new query string parameters and display the details for the first product chosen.
    Is there a way to make the session scoped bean recognize the query string parameters past the first request?

    I was able to replicate this problem with a very simple app that performs a redirection... just like the real app. Here's the simple app that I put together:
    From request scope page:
    <f:view>
             <h:form>
               <h:commandButton value="Link 1" action="#{reqbean.Link1}"/>
               <br/><br/>
              <h:commandButton value="Link 2" action="#{reqbean.Link2}"/>
            </h:form>
           </f:view>
    From request scope bean:
    public String Link1() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=1");
        return null;
      public String Link2() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=2");
        return null;
      }At this point... I put a println in the constructor of the session scoped bean because this is where I want to get the query string params. The constructor only gets called the first time a redirect is performed.

  • Add FacesMessage to FacesContext in an session scoped bean HOWTO?

    I have an simple question. How can I add an FacesMessage to the FacesContext in a session scoped bean.
    This code works fine for request scoped beans.
    String message = "Some message";          
    FacesMessage curentMessage = new FacesMessage(message, message);
    curentMessage.setSeverity(FacesMessage.SEVERITY_ERROR); //Mark as ERROR
    context.addMessage(�userForm�, curentMessage);          When I change bean scope to "session" I am getting java.lang.IllegalStateException at the last line when adding message to context.
    Thanks:
    -- Nermin

    I have an simple question. How can I add an
    FacesMessage to the FacesContext in a session scoped
    bean.
    This code works fine for request scoped beans.
    String message = "Some message";          
    FacesMessage curentMessage = new FacesMessage(message,
    message);
    curentMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
    //Mark as ERROR
    context.addMessage(�userForm�, curentMessage);          When I change bean scope to "session" I am getting
    java.lang.IllegalStateException at the last line when
    adding message to context.
    Thanks:
    -- NerminHow do you get "context"? If you are storing it as an instance variable of the bean, then you
    should expect to get an exception. The FacesContext is scoped only to one request. Instead
    of storing it in the bean, use FacesContext.getCurrentInstance() each time you need to use it.

  • NullPointerException When trying to Get Session Scoped Bean data in another ManagedBean

    hello
    i wont to access to some data in my session scoped bean from a request bean so when i try to get this data all i get is 
    com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection
    on managed bean «discussionlaoder»
    in the end of the exception there is
    Caused by: java.lang.NullPointerException at Hiber.discussionlaoder.init(discussionlaoder.java:35)
    this is my code:
    1-the request scoped bean
    @ManagedBean
    @RequestScoped
    public class discussionlaoder {
      private MyadmninHelper halper;
    @ManagedProperty(value="#{serviceBean}")
         private ServicesBean  serviceBean;
        @PostConstruct
        public void init() {
          halper=getServiceBean().getHalper();  // line 35
    //seter and geter code
    2-the sesions scoped bean
    @ManagedBean (eager=true)
    @SessionScoped
    public class ServicesBean {
        private MyadmninHelper halper;
    //seter and geter code
    am using glassfish server 3.1
    thank's for help

    What you need to do is fix all those typos in your code, then you don't have to override names.
    - the proper Java class name is DiscussionLoader, not discussionlaoder (fix english typo also)
    - if you want to inject a class named ServicesBean, then also call the property the same.
    @ManagedProperty
    public ServicesBean servicesBean;
    But what you're doing now is call the class 'ServicesBean' and then in your managed bean declaration you seem to change your mind and it should all of a sudden be 'serviceBean'. Well then rename the class so you don't have your typo anymore!

  • Are session-scoped beans singleton

    Hi all, I miss something in the bean lifecycle within JSF. Assume that a page action navigates toward another page, linked to a session-scoped bean: this is created for the duration of this session. Then a button leads back to the original page, so that another action will lead to another page with its associated bean. Is this a new bean or the previous one ?
    This question is linked to the topic of bean dependencies through managed properties: it works fine, but since a bean is declared per class and not per instance, I miss the overall instantiation philosophy.

    Once the bean is created the first time in session, it will not be created again (until the session dies and you attempt to access the bean again of course).
    So in your scenario, the first time you access the page the bean gets created. When you go back and then go forward to the page again, a new bean is not created. The originally created one is re-used. Which means the constructor is not called again.
    CowKing

  • Passing values between views in View Scoped Bean

    I have a form page that uses a view scoped backing. This page forwards to a confirmation page that uses the same backing bean. I would like to redisplay the information to the user that they entered in the form and then process these values when they hit submit on the confirmation page. However, when on the confirmation page, all of the values from the bean are null. I understand that view scoped beans are destroyed when you go to a new view, but when this bean was request scoped I could see the values on this page and save them in hidden inputs to process in the backing bean. I can still see the form values in the request parameters. Also, I cannot use a request scoped bean due to multiple ajax requests that are on the form. How can I propagate the values from the first form page to the second confirmation page?
    I am using Mojarra JSF 2.0
    Edited by: edenbaptiste on Apr 22, 2010 4:25 PM

    Here is some Sample code.
    The Payment Page:
    <ui:composition>
        <form jsfc="h:form" id="form">
            <h:messages/>
            <select id="paymentMethod" jsfc="h:selectOneRadio" value="#{testPaymentBean.paymentMethod}" immediate="true">
                <option jsfc="f:selectItem" itemValue="first" itemLabel="Pay with First Type"/>
                <option jsfc="f:selectItem" itemValue="second" itemLabel="Pay with Second Type"/>
                <f:ajax render="paymentPanel"/>
            </select>
            <h:panelGroup id="paymentPanel">
                <ui:include src="#{testPaymentBean.paymentPanel}"/>
            </h:panelGroup>
            <h:commandButton action="#{testPaymentBean.handlePayment}" value="Submit"/>
        </form>
    </ui:composition>The First Payment Type Form Fragment:
    <ui:composition>
        <h:panelGroup layout="block">
            <h:outputLabel for="amount" value="Enter Payment Amount: " />
            <h:inputText value="#{testPaymentBean.amount}">
                <f:validateLongRange minimum="0" />
            </h:inputText>
            <h:message for="amount"/>
            <br />
            <h:outputLabel for="holderName" value="Enter Account Holder Name: " />
            <h:inputText value="#{testPaymentBean.name}" />
            <h:message for="holderName"/>
            <br />
            <h:outputLabel for="accountNumber" value="Enter Account Number" />
            <h:inputText value="#{testPaymentBean.accountNumber}">
                <f:validateLongRange minimum="0" />
            </h:inputText>
            <h:message for="accountNumber"/>
        </h:panelGroup>
    </ui:composition>The Second Payment Type Form Fragment:
    <ui:composition>
        <h:panelGroup layout="block">
            <h:outputLabel for="amount" value="Enter Payment Amount: " />
            <h:inputText value="#{testPaymentBean.amount}">
                <f:validateLongRange minimum="0" />
            </h:inputText>
            <h:message for="amount"/>
            <br />
            <h:outputLabel for="holderName" value="Enter Account Holder Name: " />
            <h:inputText value="#{testPaymentBean.name}" />
            <h:message for="holderName"/>
            <br />
            <h:outputLabel for="accountNumber" value="Enter Account Number" />
            <h:inputText value="#{testPaymentBean.accountNumber}">
                <f:validateLongRange minimum="0" />
            </h:inputText>
            <h:panelGroup id="physicalAddrPanel" layout="block"
                          style="display: #{testPaymentBean.physicalAddressDisplayStyle}">
                <h:outputLabel for="addrFirstLine" value="Address Line 1: " />
                <h:inputText value="#{testPaymentBean.streetLineOne}" />
                <h:commandLink value="Use PO Box" immediate="true">
                    <f:ajax render="poBoxPanel physicalAddrPanel" />
                    <f:setPropertyActionListener value="display" target="#{testPaymentBean.poBoxDisplayStyle}"/>
                    <f:setPropertyActionListener value="none" target="#{testPaymentBean.physicalAddressDisplayStyle}"/>
                </h:commandLink>
                <h:message for="addrFirstLine"/>
                <br />
                <h:outputLabel for="addrSecondLine" value="Address Line 2: " />
                <h:inputText value="#{testPaymentBean.streetLineTwo}" />
                <h:message for="addrSecondLine"/>
                <br />
                <h:outputLabel for="addrThirdLine" value="Address Line 3: " />
                <h:inputText value="#{testPaymentBean.streetLineThree}" />
                <h:message for="addrThirdLine"/>
            </h:panelGroup>
            <h:panelGroup id="poBoxPanel" layout="block"
                          style="display: #{testPaymentBean.poBoxDisplayStyle}">
                <h:outputLabel for="poBox" value="PO Box Number: " />
                <h:inputText value="#{testPaymentBean.poBoxNumber}">
                    <f:validateLongRange minimum="0" />
                </h:inputText>
                <h:commandLink value="Use Physical Address" immediate="true">
                    <f:ajax render="poBoxPanel physicalAddrPanel" />
                    <f:setPropertyActionListener value="none" target="#{testPaymentBean.poBoxDisplayStyle}"/>
                    <f:setPropertyActionListener value="display" target="#{testPaymentBean.physicalAddressDisplayStyle}"/>
                </h:commandLink>
                <h:message for="poBox"/>
                <br />
                <h:outputLabel for="zipCode" value="Zip Code: " />
                <h:inputText maxlength="5" size="5" value="#{testPaymentBean.zipCode}">
                    <f:validateLongRange minimum="0" />
                    <f:validateLength minimum="5" />
                </h:inputText>
                <h:message for="zipCode"/>
            </h:panelGroup>
        </h:panelGroup>
    </ui:composition>The Backing Bean:
    import java.io.Serializable;
    import javax.faces.bean.ManagedBean;
    @ManagedBean()
    public class TestPaymentBean implements Serializable{
        private String paymentMethod;
        private String name;
        private double amount;
        private String accountNumber;
        private int poBoxNumber;
        private String streetLineOne;
        private String streetLineTwo;
        private String streetLineThree;
        private String zipCode;
        private String poBoxDisplayStyle;
        private String physicalAddressDisplayStyle;
        private boolean poBoxUsed;
        public TestPaymentBean(){
            paymentMethod = "first";
            poBoxDisplayStyle = "none";
            physicalAddressDisplayStyle = "display";
        public String getPaymentPanel() {
            if(paymentMethod.equalsIgnoreCase("second")){
                return "/sections/formfragments/testSecondPaymentContentPanel.xhtml";
            } else if(paymentMethod.equalsIgnoreCase("first")){
                return "/sections/formfragments/testFirstPaymentContentPanel.xhtml";
            return null;
        public String handlePayment(){
            if(paymentMethod.equalsIgnoreCase("second")){
                return handleSecondPayment();
            } else if(paymentMethod.equalsIgnoreCase("first")){
                return handleFirstPayment();
            return null;
        private String handleSecondPayment() {
            poBoxUsed = poBoxDisplayStyle.equalsIgnoreCase("display");
            return "testpaymentconfirmation";
        private String handleFirstPayment() {
            return "testpaymentconfirmation";
        public String handleSecondConfirm() {
            return "testpaymentsuccess";
        public String handleFirstConfirm() {
            return "testpaymentsuccess";
        //Getters and Setters
    }The Confirmation Page:
    <ui:composition>
        <form jsfc="h:form" id="form">
            <c:choose>
                <c:when test="#{fn:containsIgnoreCase(testPaymentBean.paymentMethod, 'first')}">
                    <ui:include src="/sections/formfragments/testFirstPaymentConfirmationContentPanel.xhtml"/>
                </c:when>
                <c:when test="#{fn:containsIgnoreCase(testPaymentBean.paymentMethod, 'second')}">
                    <ui:include src="/sections/formfragments/testSecondPaymentConfirmationContentPanel.xhtml"/>
                </c:when>
            </c:choose>
        </form>
    </ui:composition>

Maybe you are looking for

  • How do I import video from my Canon ZR40 into my iMac?

    I've got a Canon ZR40 DV camcorder that's about 5 years old and a brand new iMac. I've also got a firewire cable that connects the camcorder to the computer...but beyond that I'm clueless. When I connect the two devices via the cable, I'm not seeing

  • Automatically create ODBC DSN connection with special port and password. Add-OdbcDsn cmdlet

    Hi, I first posted a question in the SQL forum but I'm posting it here instead because its a Powershell question. In a non-persitent VDI enviroment we are trying to automatically create a ODBC DSN connection to a SQL server. We are using Windows 8.1

  • Installing OS X on my 2nd mac

    Hello, Recently I purchased Mountain Lion for my iMac. It's in my purchased section and now I want to download it on my Macbook (same Apple ID), but do I need to pay for it again or can I download it for 'free' because I already paid for it? Thank yo

  • Could not open key

    Every time I try to upgrade QuickTime, a box opens saying: Could not open key HKEYLOCALMACHINE\Software\Classes\QuickTimePlayerlib.QuickTimePlayerApp\CLSID. Verify that you have sufficient access to that key, or contact your support personal. PLEASE

  • Transformation routine used for GR as at posting date (0GR_VAL_PD KF)

    HI all,           I have problem in 2lis_02_scl transformation Routine where i am not getting corect data for GR as at posting date (0GR_Val_pd) KF. Can anyone tell me what routine shall i try to use. Thanks n Regards, Gaurav Sekhri