What is differnce between following to getting the Application Module ?

1-
    public static SimpleAM  getSimpleAM() {
        DCBindingContainer bindingContainer =
            (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        SimpleAM  simpleAM  =
            (SimpleAM  )bindingContainer.getDataControl().getDataProvider();
        return SimpleAM  ;
    }2-
   public SimpleAM  getApplicationModule() {
        FacesContext context = FacesContext.getCurrentInstance();
        ValueBinding vb =
            context.getApplication().createValueBinding("#{data}");
        BindingContext bc = (BindingContext)vb.getValue(context);
        DCDataControl dc = bc.findDataControl("SimpleAMDataControl");
        return (SimpleAM )dc.getDataProvider();
    }The first one giving ClassCostException why ?
In Some case it is working fine.
My question which one is correct to get the AM and why ?

One more doubts,
I added Client method in the page binding.i want to know,Each page has one page def .Page def is representing binding for that particular page.When we request any page at that time the container going to create the Binding object.User will be able to access the all attribute of binding.
My question is that ,At that time Binding container will represent only one Binding Object ?If user click any other pages then the previous Binding Object will lost ?
Or is there any Global Binding Object,Where i can add any method that will access through whole project.
Thanks

Similar Messages

  • How to get the application module instance in backing bean.

    This is Ramesh, I am new to JDeveloper world.
    In my current application I have change password screen which allows user to change there password.
    Here this is a pop-up page. Here I don't have the view object and pagadef for this changepassword.jspx file.
    My aim is to call the Application Module method which takes the user name, old password and new password.
    In backing bean I am trying to call this method by using
    MyProjAM obj = _binding.getDataControl().getApplicationModule();  //throw null pointer exception.
    _binding is the object of DCBindingContainer. 
    ( I have created the parameter called "binding" as my managed bean property and values as #{binding})
    But the above line is throwing the NullPointerException.
    Could you please help me to come out of this problem.
    Thanks and Regards,
    Ramesh Biradar.

    If your page has no page definition, then #{bindings} will be null during the request for that page.
    If you need your page to invoke a data control method when you press a button, the simplest (and declarative) way is publish your AM method on the AM's client interface, then drop the method as a button from the data control palette onto your page. You don't even need a backing bean to accomplish this.
    That said, you can refer to a data control in a backing bean using the expression #{data.[i]YourAppModuleNameDataControl.dataProvider}
    So, assuming you have a helper method like this:
      public static Object EL(String expression) {
        FacesContext ctx = getFacesContext();
        Application app = ctx.getApplication();
        ValueBinding bind = app.createValueBinding(expression);
        return bind.getValue(ctx);
      }and assuming that your application module is named SRService
    and assuming that you have correctly nominated any Application Module custom methods as being available to clients by selecting them on the "Client Interface" panel of the application module editor, then in a backing bean you can acquire an instance.
    Then, the ADF design time will have automatically generated you a custom AM client interface named SRService and you can reference that service interface in your backing bean by using code like this:
            SRService svc = (SRService)EL("#{data.SRService.dataProvider}");
            svc.yourCustomMethod(your,args);

  • What can be done to avoid getting the following error when trying to delete unused clips he operation could not be completed.  *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil

    what can be done to avoid getting the following error when trying to delete unused clips in Imovie 09 "the operation could not be completed.  *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil"  I use to get these type of error messages when trying to delete unsused clips from a large event 60 minutes or longer, but now I get this message when trying to reduce a 4 minute event.
    Also, does anyone know if there is a limit to the total amount of space that can be taken up by Projects in Imovie 09
    Thanks for any help

    Zachy,
    It goes something like this...
    Put your new drive in the enclosure. Use Disk Utility to format it, etc. I'd give it a slightly different name than the original. Let's say you have Old Disk and New Disk as your drive names. Use Carbon Copy Cloner to copy Old Disk to New Disk. Now you should have an exact copy, which you can test by rebooting and holding down the Option key. Choose New Disk from the list and let it boot, make sure all is well.
    Shut down and physically swap the drives. Take Old Disk and put it in the enclosure. Now your system has a new disk with a lot more space and you can reformat your old disk and just use it for large files or whatever.

  • What do I do when I get the message my printer is not connected? HP Officejet Pro 8500A e-All-in-One

    What do I do when I get the message my printer is not connected when I want to print wirelessly.? HP Officejet Pro 8500A e-All-in-One.  I have a macintosh computer using snow leopard.  I have used the printer for 6 months.  Nothing has changed.  I shut off the printer and turned it on.  The internet is working altough I will turn it off and on.  What do I do next?  Thank you.

    The easiest and fastest thing for you is to reset the printer to its defaults and then just install the printer again following the instructions in the manual when you received it.  If you don't have these you will find this on the HP web site.
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • HT6114 I have an iMac running OS X 10.5.8, and in order to run newer applications I apparently need to upgrade my OS.  Since this OS is fairly old, what steps must I follow to get my computer up to date?  I seem to recall hearing that it may take several

    I have an iMac running OS X 10.5.8, and in order to run newer applications I apparently need to upgrade my OS.  Since this OS is fairly old, what steps must I follow to get my computer up to date?  I seem to recall hearing that it may take several steps and may require new versions of iWorks and iLife (at least)

    The relevant information is:
    Model Name:          iMac
      Model Identifier:          iMac9,1
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          2.93 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache:          6 MB
      Memory:          4 GB
      Bus Speed:          1.07 GHz
      Boot ROM Version:          IM91.008D.B08
    Chipset Model:          NVIDIA GeForce GT 120
      Type:          Display
      Bus:          PCIe
      PCIe Lane Width:          x16
      VRAM (Total):          256 MB
      Vendor:          NVIDIA (0x10de)
      Device ID:          0x0655
      Revision ID:          0x00a1
      ROM Revision:          3370
      Displays:
    iMac:
      Resolution:          1920 x 1200
      Depth:          32-Bit Color
      Core Image:          Hardware Accelerated
      Main Display:          Yes
      Mirror:          Off
      Online:          Yes
      Quartz Extreme:          Supported
      Built-In:          Yes
    Display Connector:
      Status:          No Display Connected

  • When I tried to open Lightroom 5.4 today I got a msg that says "Lightroom encountered an error when reading from its preview cache and needs to quit. Lightroom will attempt to fix this problem the next time it lauches". What do I do? I get the msg each ti

    "Lightroom encountered an error when reading from its preview cache and needs to quit. Lightroom will attempt to fix this problem the next time it lauches". What do I do? I get the msg each time I try to open it.

    It isn't a file, it's a folder. It will have the same name as your catalog, but will have the extension data. It will be in the same folder along with your catalog. If you need to use the search feature to search for *.lrdata.

  • HT1338 I'm trying to download java on my Mac machine but the software update doesn't show me anything. Please advise what I should do to get the application.

    I'm trying to download java on my Mac machine but the software update doesn't show me anything. Please advise what I should do to get the application.

    If you can run it under chrome, you have java installed.
    There was some malware that exploited an older version of Java (not javascript) running in a Browser. Since few people use it Apple turned off Java by default in the Safari Browser.
    If you need it for something, just turn it back on in Safari preferences (inside Safari). After a few months of non-use, you may find it has turned itself off again.

  • HDMI cable connected from TV to Mac, what do I click on to get the movie on my laptop screen to show on my TV screen?

    HDMI cable connected from TV to Mac, what do I click on to get the movie on my laptop screen to show on my TV screen?

    When you first hook it up it will probably have the display set in Extended Desktop mode. The Menu Bar and Dock will be on the MacBook display and your background screen on the TV but you can move the cursor onto the TV screen.
    In System Preferences>Display on the MacBook screen there should be an Arrangement tab when you have the MacBook hooked up to the TV and both screens working. When you click the Arrangement tab do you see two monitors side by side? One of them will have a Menu Bar at the top. Just click on the Menu Bar and drag it to the second monitor. That will make the second monitor your main screen.
    The TV will now have the Dock and Menu Bar and windows will open on it. But you can move the cursor to the MacBook screen and move windows from the TV over to the MacBook screen.
    You can now use your MacBook in Clamshell Mode with a wired or Bluetooth keyboard and mouse.  http://support.apple.com/kb/HT3131 When you disconnect from the TV your Menu Bar will automatically change back to the MacBook.
    Or if you want to use the MacBook’s keyboard and trackpad to work on the MacBook screen while showing it on a TV you can check the Mirror Display box on the lower left hand side of the Arrangement tab under the two monitors box. That will give you the same screen at the same resolution on both the MacBook and the external monitor.

  • What api would I use to get the number of chars in string?

    What api would I use to get the number of chars in string?

    Assuming that you really mean that you want the number of charaters in a String (not string), that would be documented in java.lang.String
    The method is length()

  • What does it mean when I get the error of iTunes Library .itl file is locked

    What does it mean when I get the error iTunes Library .itl file is locked

    It means that your iPod Hardisk has crashed and cant be started, you need to have the Hardisk replaced at Apple Store or any 3rd Party iPod service, if it is out of warranty.

  • What do I do if I get the message "The iTunes library file is locked, on a locked disk, or you do not have write permission for this file" when I try to open up iTunes?

    What do I do if I get the message "The iTunes library file is locked, on a locked disk, or you do not have write permission for this file" when I try to open up iTunes?

    Read the part about changing permissions on the iTunes folder in: https://discussions.apple.com/message/11583914

  • When I open "mail" all that opens is the gray ribbon on the top.I have to go to "Mailboxes/inbox" to get it to aspen. What happened? How do I get the full screen to open when I click my "mail" icon like it used to?

    When I open "mail" all that opens is the gray ribbon on the top.I have to go to "Mailboxes/inbox" to get it to aspen. What happened? How do I get the full screen to open when I click my "mail" icon like it used to?

    Move your cursor way over to the right side of the window. There should be a thin bar. when you hover over the left side of the thin bar, the cursor will change to a vertical bar with an arrow sticking out the left. Click and drag to the left.

  • What do I do when I get the message "Your Apple ID has been disabled" when trying to purchase songs?

    What do I do when I get the message "Your Apple ID has been disabled" when trying to purchase songs? How do I enable it again so that I can purchase songs again?

    Enter "Apple ID disabled" in the search box at the top of this page.
    http://support.apple.com/kb/TS2446

  • HT2731 What do you do when you get the message could not sign in an unknown error has occurred

    What do you do when you get the message could not sign in an unknown error has occurred when it ask for your password while trying to download apps?

    In settings I signed out of my iTunes account, then signed back in.
    It’s now working for me… Hope this helps.

  • When trying to logout, I keep getting "the application safari canceled logout" even though I am not in Safari. This only recently started happening and I'm wondering if it is a setting issue or bug. Can someone tell me what to do?

    When trying to logout, I keep getting "the application safari canceled logout" even though I am not in Safari. This only recently started happening and I'm wondering if it is a setting issue or bug. Can someone tell me what to do?

    You don't have to be "in" Safari for it to cancel logout.
    You have several different Applications open, and any one of them may cancel logout if conditions are just right.
    Quit the Applications you are no longer using and your Mac will run better and faster. And it will logout instead of cancelling.

Maybe you are looking for

  • How can spwan out parallel HBR in one single batch file?

    We have several Hyperion business rules to be executed at night batch. To ease the control and management, we put all business rules under one single batch file. However how can we spawn out different business rules so that these rules can be execute

  • Download paused

    I prepurchased a book.  I received notification that it was available and attempted to download it.  It is now permanently paused in my library and won't budge.  I did manage to download it on my phone. 

  • FileVault can't copy disk image?

    Hi Folks, I wanted to enable FileVault on my computer but it keeps failing when I try to initiate it. I get a message saying that it can't copy disk image. What can I do about that? I won't be back online until Friday so if you have any more question

  • Adobe application manager won't open

    I just subscribed to Adobe Cloud CC , but my download won't work because Adobe application Manager won't launch. Any suggestions ? Vic

  • Jumping back a page.

    I have set up a form with a following php page that compares the 2 email entries and if they are not the same sends me to an error page. Click on the link there and you will be sent back to the Form without loss of the entries on the form. Well it wo