ADF Faces and BC: Scope problem with managed bean

Hi,
I am using JDev 10.1.3 and ADF Faces with ADF BC.
I have created a managed bean which needs to interact with the binding layer and also receive actions from the web pages. I have a managed property on the bean which is defined as follows:
<managed-bean>
    <managed-bean-name>navigator</managed-bean-name>
    <managed-bean-class>ecu.ethics.view.managed.Navigator</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
      <property-name>bindings</property-name>
      <value>#{bindings}</value>
    </managed-property>
  </managed-bean>I need the been to session scope because it needs to keep previous and next pages to navigate the user through their proposal. If i use session scope (as above) i get the following error when i click on a comand link which references a method in the above bean: #{navigator.forwardNext_action} which returns a global forward.
this is the exception:
javax.faces.FacesException: #{navigator.forwardNext_action}:
javax.faces.el.EvaluationException: javax.faces.FacesException:
javax.faces.FacesException: The scope of the referenced object: '#{bindings}' is shorter than the referring object     at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)     at
oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211) at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)     at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)     at
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)     
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)     at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)how can i get around this?
Brenden

Hi pp,
you need to create a managed (not backing) been set to session scope.
You can call/reference the managed bean from your page.
the backing bean is designed around a page lifecyle which is request oriented in it's design.
This is a simple managed bean from faces-config.xml
<managed-bean>
    <managed-bean-name>UserInfo</managed-bean-name>
    <managed-bean-class>ecu.ethics.admin.view.managed.UserInfo</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
      <property-name>bindings</property-name>
      <property-class>oracle.adf.model.BindingContext</property-class>
      <value>#{data}</value>
    </managed-property>
  </managed-bean>and the getters and setters for bindings in your session scope managed bean:
    public void setBindings(BindingContext bindings) {
        this._bindings = bindings;
    public BindingContext getBindings() {
        return _bindings;
    }you can access the model from the managed bean using the the BindingContext if needed.
also have a look at JSFUtils from the ADF BC SRDemo application, there are methods in this class such as resolveExpression which demonstrate how to get the values of items on your page programatically using expression language. You can use this in your managed bean to get values from your pages.
regards,
Brenden

Similar Messages

  • Problems with managed beans on included JSPs

    I've got a problem with managed beans within an included JSP
    The included page looks as follows:
    <f:subview id="includedPage" binding="#{testBean.component}">
         <h:outputText value="Hallo from the included page"/>
         <h:outputText value="#{testBean.msg}" />
    </f:subview>The including page is also very simple
    <f:view>
         <html>
              <head>
                   <title>Test include</title>
              </head>
              <body>
                   <h:outputText value="Hello from the including page"/>               
                   <jsp:include page="included.jsp"/>
              </body>
         </html>
    </f:view>The testBean is a managed bean with page scope and looks as follows:
    public class TestBean {
        public UIComponent fComponent;
        public TestBean() {
            System.out.println("TestBean Constructor called " + toString() );
        public String getMsg() {
            return "Component = " + fComponent ;
        public void setComponent(UIComponent component) {
            System.out.println("setComponent called " + component);       
            fComponent = component;
        public UIComponent getComponent() {
            System.out.println("getComponent called " + fComponent);
            return fComponent;
    }The output to the console is:
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@1bc16f0
    getComponent called null
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@18622f3
    setComponent called javax.faces.component.UINamingContainer@160877b
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@5eb489
    and the page displays
    Hello from the include page
    Hello from the included page Component = null
    Can anyone explain this behavior ? What's the reason that the page displays
    Component = null
    and is it possible to display the parent naming container (subview) this way ?
    how ?
    Thanks

    By "page scope" I assume you mean "none"? If so JSF creates a new bean for each place it's referenced. The closest to the behavior you want, once per "page", is really request scope.
    (I'm not sure why the constructor is being called thrice, though. I should look into this.)
    I assume you want a bean-per-subview scenario. This should be doable, and one way that allows a dynamic number of subviews would be as follows:
    --create a "manager" bean in request scope
    --give it get/set methods that retrieves a Map of "TestBean" instances; the idea is that each subview use a different key "s1", "s2", etc
    back the manager method with Map implementation that checks if there's already a TestBean associated with the key returns it if yes, else null.
    If that seems messy, the component solution is hairy :-) See http://forum.java.sun.com/thread.jspa?threadID=568937&messageID=2812561
    --A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • ADF Faces and Struts confusion

    Hello alltogether,
    I'm developing with struts for some years now but I'm completely new to ADF and Faces.
    I want to integrate a "simple" ADF Faces page with one TreeTable to an existent struts application.
    The idea I had is to create an action within the struts-config.xml inheriting from the DataAction or DataForwardAction in order to load and prepare the data for the TreeTableModel.
    When I call the ADF Faces page using the .do call for the Action created (I have to prepend /faces/ to the normal Action call) the page is rendered correctly but I do not enter my derived Action class at all.
    So my question is: How is the preferred way to fill the Model of the TreeTable before the ADF Faces page is rendered. The necessary datasource is obtained from a struts basic action throughout the whole application.
    I'm now struggeling with the pageDef.xml (using the documentation from here: http://www.oracle.com/technology/documentation/jdev/b25947_01/index.html) but I'm really lost since I do not understand what happens when and how resp. why it happens.
    All I want is the following: Prepare and load the necessary TreeModel before the page gets rendered (the appropriate model depends on a parameter which is given in the request that is send and which successfully response should be the ADF Faces page with the TreeTable filled with the appropriate data)!
    Can please somebody give me the necessary piece of advice?
    I'm trying for almost a day now!
    Many thanks in advance
    Best Regards

    Dear Mr. Vohra, It is not yet Clear whether we can use ADF Faces with Tiles,
    With out using Facelets, of MyFaces?
    Some users say they are using these two frameworks, but still complain of problems.
    And you are suggesting to use facelets with ADF faces .
    Can't we use ADF Faces and Tiles with out any other intermediate technology?
    Thanking you,
    Samba.
    Message was edited by:
    saasira

  • ADF Faces and MapViewer

    Hello,
    i'm investigating the possibility to write an ADF Faces MapViewer Client. I'm especially thinking of some Google Maps style navigation, e.g. panning by dragging the map.
    I'd like to use AJAX to prevent full page reloads, so if i drag the map only the map image is reloaded.
    Now the question are:
    1. How do i extend the ADF Faces Components with AJAX Scripts without breaking the ADF Faces PPR concept?
    2. Is it possible to trigger the reload of an ADF Faces component from my javascript?
    3. Is it possibe to extend the java classes for the components or the renderer with my own code?
    4. Has anyone already created an example that uses ADF Faces and MapViewer?
    Thanks for help,
    Dirk

    Hi,
    I just talk with our admin. The problem was server port 8080. Some of internet providers (also one of the biggest Polish) blocks this port. It's a reason - when I change internet connection to other everythig works OK. I thing it would be nice to change server port to default 80, if you want to make this application accessile for all.
    Kuba

  • Hi, I have a macbook air os x 10.9.5 and I have problems with the app store. It doesn't open anyway. so, how can I install it again or update. I have problems with preview too, the same, doesn't open the application

    Hi, I have a macbook air os x 10.9.5 and I have problems with the app store. It doesn't open anyway. so, how can I install it again or update. I have problems with preview too, the same, doesn't open the application

    Reinstalling OS X Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Reinstalling OS X Without Erasing the Drive
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility and press the Continue button. After Disk Utility loads select the Macintosh HD entry from the the left side list.  Click on the First Aid tab, then click on the Repair Disk button. If Disk Utility reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit Disk Utility and return to the main menu.
    Reinstall OS X: Select Reinstall OS X and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Alternatively, see:
    Reinstall OS X Without Erasing the Drive
    Choose the version you have installed now:
    OS X Yosemite- Reinstall OS X
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
    OS X Lion- Reinstall Mac OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

  • ADF Faces and BC4J integration

    If I drag and drop my BC4J View Objects from the data control palette, Jdeveloper 10G generates an input form using tags from the struts TLD (WEB-INF/struts-html.tld).
    How can I configurate JDeveloper to use the ADF Faces tags in this case?
    Now JDeveloper generates for an attribute in an input form this code:
    <html:text property="CodigoTipoCliente"/>
    I want to generate something like this:
    <af:inputText property=”xx”> where xx is the attribute name for the BC4J.
    Is this possible?
    If it not possible, can I integrate ADF Development to JSF?
    thanks

    i have a requirement where i need to have Java Beans as Model Layer in ADF Faces.
    i have executed a project in ADF UIX with Java Beans Model Layer it works fine.
    but when i tried the same in ADF Faces like i have created some java beans as Data controls and drag and drop them onto the JSP page which in turn convert into <af:inputText value="#{bindings.lastName.inputValue}"
    label="Last Name"
    required="#{bindings.lastName.mandatory}"
    columns="#{bindings.lastName.displayWidth}"
    binding="#{backing_inputPage.inputText2}"
    id="inputText2">
    <af:validator binding="#{bindings.lastName.validator}"/>
    </af:inputText> but these fields are always shown as ReadOnly fields even though i set the readOnly attribute to false and by which i cannot insert any values into it on runtime
    but where as when i convert them into normal JSF HTML tags then i can enter values and even pass values between pages but WHY DO I NEED TO DO THIS
    is the ADF FACES JAVA MODEL LAYER IS NOT YET integrated or what?
    please reply or clarify

  • I have an ipad mini 1st gen 64 gb (wifi only) and i have problem with some of my apps. These apps have lags when you play with them for a few seconds the apps are having lags are call of duty strike team, gta San Andreas and nfs most wanted.pleas help me

    I have an ipad mini 1st gen 64 gb (wifi only) and i have problem with some of my apps. These apps have lags when you play with them for a few seconds the apps are having lags are call of duty strike team, gta San Andreas and nfs most wanted.pleas help me

    I'm going to guess videos buffer for a while also...
    Two possibilities, one is you should close apps on the iPad, the other is your internet speed is not able to handle the demands of a high speed device.
    To close apps:   Double click home button, swipe up to close the apps.
    To solve internet problem, contact your provider.   Basic internet is not enough for video games and movies.   Your router may be old and slow.

  • I am using my Ipad on a remote craftshow site and am having problems with battery lasting 8 hrs. Can I use a 12v rv battery to recharge it or atleast maintain the charg over longer periods of time? I have a dc adapter. thanks

    I am using my Ipad on a remote craftshow site and am having problems with battery lasting 8 hrs. Can I use a 12v rv battery to recharge it or at least maintain the charge over longer periods of time? I have a dc adapter. thanks

    You should be able to use the battery if you get a car type charger which recharges mobile devices.
    The full size iPads use a 10-12W charger, whereas the mini uses a 5W charger. Many car chargers only supply 5W. But at 5W, the car charger should give you some extra time on your iPad. It would be best to use a 10-12W car charger.
     Cheers, Tom

  • Hi my name Abukar I had an old apple ID and I had problem with signing it so I decided to make a new apple ID with a new email address, so how can I link with two apple IDs and how can I get back all my previous apps that I purchased before, I cloud stuff

    Hi my name Abukar I had an old apple ID and I had problem with signing it so I decided to make a new apple ID with a new email address, so how can I link with two apple IDs and how can I get back all my previous apps that I purchased before, I cloud stuff

    It is not possible to do that.
    Allan

  • Would love Steve Jobs to contact me for in setting screen tinting orange for seizures as OK WE HAVE DONE IT AN ORANGE PROTECTIVE SCREEN OVERLAY FOR IPOD AND IPAD STOPPING JOHN'S photosensitivity SEIZURES AND STOPPING EYE PROBLEMS WITH USAGE

    OK WE HAVE DONE IT AN ORANGE PROTECTIVE SCREEN OVERLAY FOR IPOD AND IPAD STOPPING JOHN'S SEIZURES AND STOPPING EYE PROBLEMS WITH USAGE ABLE TO CUT ANY SIZE FOR PHONES EG
    Contact me Steve the idea is great and the pictures are reveal a better depth perception of colour call me a Mum that created a diffence for her son and kept him communicating on his ipod and his ipad proffessors were amazed at childrens hospital and would love to show you my ideas in making it built in to your ipod and ipads or any computer for that matter everyone i show is blown away not only that but a wider customer level will be reached from a Mum that made a difference for her son that was unable to communicate and then had seizures so developed my own cover that allows him to chat all day without having any eye problems.
    So we now sell the covers on ebay to help others access technology that they need in order to survive and live happily as without his ipod or ipad and him telling us what was wrong he would of died he had respritory lung disease photosensitive epilepsy a metabolic condition that could of killed him anytime from stroke or seizure battled with using all types of technology but now is a dream come true.
    Would love for this to be enabled in the setup of all computers alike to protect eyes and allow more users to speak and communicate a big thankyou to the creators and designers fabulous but please can you call me as this could make you even better i mean will and also give me more time.
    From one praying God fearing Mum
    Nadine
    Call me i do have better pics they were too big to upload orange covering on right hand side

    Going through the feedback and support pages will be a waste of your time. Apple won't respond to feedback, and support can't do anything regarding product suggestions, particularly not from a company with an existing product they wish to sell. The only attention you might get from Apple would be possible interest in selling your product through the Apple Stores, and I don't know how Apple chooses the third-party products they sell. All I could suggest would be writing to Apple's corporate headquarters:
    Apple
    1 Infinite Loop
    Cupertino, CA 95014
    with perhaps "Attention: Retail Sales Division" and telling them about your product and your interest in it being sold through the Apple Stores.
    Regards.

  • I use only two channels, have plenty of memory in my hard disk, and external hard drive, no effects, and still having problems with Garage band. Giving messages as you have too many live channels

    I'm frustrated, I am doing everything you recommend, I use only two channels, have plenty of memory in my hard disk, and external hard drive, no effects, and still having problems with Garage band. Giving messages as you ave too many live channels, the disk is slow prepare...can you help?

    Quote from: Richard on 15-November-07, 20:33:05
    tornado2003,
    What you need to do is boot into Safe Mode. Then delete the VGA Drivers.
    After that boot normally and install the latest nVidia ForceWare Drivers
    Take Care,
    Richard
    i guess you missed that:
    Quote from: tornado2003 on 15-November-07, 17:26:52
    ive tryed booting xp in safe mode but it just freezes after it loads up a couple of needed files .
    ive even formatted my hard drive and tryed installing a fresh xp on it but it just keeps locking up when it gets to the "starting windows setup" .(this is just after it loads all the drivers from the xp cd)

  • I have CS4 Ilustrator and am having problems with gradient banding. I'm ripping files through Wasatch 6.7 to a Roland SC-540 printer.

    I have CS4 Ilustrator and am having problems with gradient banding. I'm ripping files through Wasatch 6.7 to a Roland SC-540 printer. Is there a fix for this? Please let me know, I have been asking here for a few days here and no answers yet? Josh

    I have CS4 Ilustrator and am having problems with gradient banding. I'm ripping files through Wasatch 6.7 to a Roland SC-540 printer. Is there a fix for this? Please let me know, I have been asking here for a few days here and no answers yet? Josh

  • Hi.have a g5 mac,dual core 2.3 unit.i bought it with no hard drive.have got hard drive,formatted for mac.i am trying to load osx.i get a grey screen with a small box in the centre with 2 character faces,and then grey apple with loading icon spinning.help?

    hi.have a g5 mac,dual core 2.3 unit.i bought it with no hard drive.have got hard drive,formatted for mac.i am trying to load osx.i get a grey screen with a small box in the centre with 2 character faces,and then grey apple with loading icon spinning.nothing is loading tho.

    I see 10.6.3 in your profile---is tthat what you are trying to load? If so, it won't work. No PowerPC Mac like your G5 can run a Mac OS version higher than 10.5.8

  • Hi i'm using iphone 4 and i have problem with viber apps while i'm installing

    hi i'm using iphone 4 and i have problem with viber apps while i'm installing & registration process its says error on system mainternance. can you please help me out?
    thank you.

    OK, let's try again. Wind is NOT a supported carrier. In order to use tethering, it must be supported and activated by your carrier for the iPhone. This usually involves an additional fee.  You will have to ask your carrier if they can enable it. Odds are, since they are not a supported carrier, they can not. If you want to use tethering, you will most likely have to switch to a supported carrier that offers this feature on the iPhone.
    A list of supported carriers can be found here: http://support.apple.com/kb/ht1937

  • I have an Imac  operating system 10.4.1 and Apple Works 6 and am having problems with Aplle Works 6. Is there a place I can download Apple Works 6 onto my computer?

    I have an Imac  operating system 10.4.1 and Apple Works 6 and am having problems with Aplle Works 6. It shuts down before I am finished. Is there a place I can download Apple Works 6 onto my computer free?

    AppleWorks has never been available for legal download.
    Have you done the usual trouble shooting steps:
    Quit AppleWorks
    Delete most or all of the Recent Items list.
    Remove the Preferences files to the Desktop or to the Trash.
    Launch AppleWorks to see if the problems remain.
    You'll find Recent Items in:
    username > Documents > AppleWorks User Documents > Starting Points > Recent Items
    There are several preferences files.
    Go to:
    username > Library > Preferences
    Locate, select and delete the file com.apple.appleworks.plist
    Still in the Preferences floder, locate and open the folder AppleWorks.
    Select and delete the two Cache files and the Preferences file.
    Button Bars is also a preferences file, but may be left where it is IF you have no problems that appear related to the Button Bar, and wish to preserve any changes you've made to the Button Bar.
    Regards,
    Barry

Maybe you are looking for

  • Multiple OS's on one Mac

    Greetings! Part of my home network consists of a Quicksilver Power Mac. To make a long story as short as possible, , I need to keep 10.2 because of some Apps i Like, I want to keep OS 9 becaus I'm a sentimental sop and I have to install a version of

  • While deploying ear in home instance ORACLE10G EM console Base Exception

    while deploying ear in home instance through ORACLE10G EM console. i am getting this exception Deployment failed: Nested exception Resolution: Base Exception: com.evermind.server.rmi.OrionRemoteException Disconnected: Connection reset. Disconnected:

  • Calculate price on the basis of total quantity of line items.

    Hi, I have a scenario. One product is selling at premium price to the standard product.When customer buy both premium product and standard product the price break up should be on the total quantity of the both products. How to achieve it in SAP sales

  • Cannot copy and paste a slideshow- and what is an Album?

    I have created a slideshow in a folder called MISC. I think it is a "slideshow" because the icon looks like a 35mm slide. I want to copy this slide show and move it to a folder called 2007. No matter what I do, I cannot copy and paste it. Once a slid

  • Language set up with photoshop elements 10

    My photoshop elements 10 is displaying in german. How can I change the language set up into english?