Adding and Calling custom method to the application module or view object

My project uses jheadstart 10.1.2.
I want to run "oracle reports" from my uix page. I have coded a method which takes "VOParameter view object" as a parameter to run report.
I have generated the input page (parameter page) which based on VOParameter view object, by using jheadstart for using jheadstart lov, date etc. advantages. But I dont know how can I add custom method on application module or view object implementation class and custom button on uix page to call from uix page.
THANKS for your help

Yes, method binding has been added to the page UI model.
I have find some clue that When I darg and drop metod as a submitButton, the code "
<SubmitButton text="runReport" model="${bindings.runReport}" id="runReport0" event="action" />"
is added to the uix page code. I change this code like this;
<button text="runReport" model="${bindings.runReport}" id="runReport0" event="action" onClick="submitForm('dataForm',1,{'event':'action','source':'runReport0'});return false"/>
by adding onClick method and changed submitButton to button tag..
Then button action is triggered. But I can not pass to the design part of the uix page. It gives me the message like that "The document is not a valid state" But it works. I dont know why?

Similar Messages

  • Calling custom methods from Nested Application Modules

    We are having a problem with passing parameters to our nested App Modules.
    We have a custom method in our nested app module and when we drag that method from our data control palette in our page everything seems to work just fine. We are binding our NamedData values to #{requestScope.<field>} where the fields are inputText controls. When we run it will execute the function but the parameters are null.
    It seems to me that the Nested App Module can not evaluate the EL expression, or in other words when it gets evaluated it returns a null.
    Can anyone help with this?
    Thanks,
    Peter

    If you use an EL expression of some hard-coded value instead of #{requestScope.XXX} does that value correctly get passed to the function?
    In other words, are you 100% sure that EL expression is not evaluating to null ?
    If you drop an AM method as a parameter form on a page, you'll see that by default it's NamedData elements use EL expressions that reference attribute bindings that are bound to local page-def variables, rather than to #{requestScope.something}

  • How to invoke a method in application module or view objects interface?

    Hi,
    perhaps a stupid RTFM question, but
    How can i invoke a method that i have published in the application modules or view objects interfaces using uiXml with BC4J?
    Only found something how to invoke a static method (<ctrl:method class="..." method="..." />) but not how to call a method with or without parameters in AM or VO directly with a uix-element.
    Thanks in advance, Markus

    Thanks for your help Andy, but i do not understand why this has to be that complicated.
    Why shall i write a eventhandler for a simple call of a AM or VO method? That splatters the functionality over 3 files (BC4J, UIX, handler). Feature Request ;-)?
    I found a simple solution using reflection that can be used at least for parameterless methods:
    <event name="anEvent">
      <bc4j:findRootAppModule name="MyAppModule">
         <!-- Call MyAppModule.myMethod() procedure. -->
          <bc4j:setPageProperty name="MethodName" value="myMethod"/>
          <ctrl:method class="UixHelper"
                  method="invokeApplicationModuleMethod"/>
       </bc4j:findRootAppModule>
    </event>The UixHelper method:
      public static EventResult invokeApplicationModuleMethod( BajaContext context,
                                                               Page page,
                                                               PageEvent event ) {
        String methodName = page.getProperty( "MethodName" );
        ApplicationModule am = ServletBindingUtils.getApplicationModule( context );
        Method method = null;
        try {
          method = am.getClass(  ).getDeclaredMethod( methodName, null );
        } catch( NoSuchMethodException e ) {
          RuntimeException re = new RuntimeException( e );
          throw re;
        try {
          method.invoke( am, null );
        } catch( InvocationTargetException e ) {
          RuntimeException re = new RuntimeException( e );
          throw re;
        } catch( IllegalAccessException e ) {
          RuntimeException re = new RuntimeException( e );
          throw re;
        return null;
      }Need to think about how to handle parameters and return values.
    Btw. Do i need to implement the EventHandler methods synchronized?
    Regards, Markus

  • Two different ways to execute a custom method in an Application Module

    I have a custom method exposed in an Application Module's Client Interface, and i know two different ways of executing it from my ADF Faces project (both works fine):
    1) Calls the method directly through the Data Control:
    MyModule service = (MyModule)JSFUtils.resolveExpression("#{data.MyModuleDataControl.dataProvider}");
    service.myMethod();
    2) Adding a Method Action in the PageDef's file:
    <methodAction id="myMethod" InstanceName="MyModuleDataControl.dataProvider"
    DataControl="MyModuleDataControl" MethodName="myMethod"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"/>
    //Call the method from the binding container
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("myMethod");
    operationBinding.execute();
    Basically i want to know: what are the differences (pros & cons) of each approach ??

    Hi,
    In my opinion the second way have a advantage, which its method could be invoke automatically using a invokeAction on pageDef, if necessary.
    regards

  • ADF Groovy call method in different application module

    Hi All,
    I have two different application modules(Say TestAM.xml and MyTestAM.xml). I have a method in second application module. I want to call that method from Entity object. Normally we use adf.object.applicationModule.getName()  if it is in the first application module
    So how do I call a method in second application module from Entity object?
    I am using JDev 11.1.1.5 and ADF BC.
    Thanks,
    Rajesh

    Hi,
    In my opinion the second way have a advantage, which its method could be invoke automatically using a invokeAction on pageDef, if necessary.
    regards

  • Question about the Application Module in bc4j

    Hi all,
    I've been playing with JDeveloper9i for a little ovar a week only and have been trying to get access to a BC4J View Object in order to execute a runtime specific query on it, by passing 2 user input values to the object, and setting the WHERE clause by a call to the setWhereClause() method on the View Object. The only way i could come across to get hold of the View Object was to create an Application Object (in this case its called Bc4jModule) and then to use a call to a custom method in the Application Module Implementation which i created and set to be a Client Method.
    The code is as follows:
    In the Application Module (Bc4jModuleImpl)
    public int authenticateUser(String strLogin, String strP_Word)
    getUsersView().setWhereClause(" LOGIN='" + strLogin + "' AND P_WORD='" + strP_Word + "'");
    System.out.println(getUsersView().getWhereClause());
    getUsersView().executeQuery();
    return getUsersView().getRowCount();
    In the JClient panel (JButton action):
    Bc4jModule app = (Bc4jModule)panelBinding.getApplicationModule();
    int n = app.authenticateUser(txtUser.getText(), txtPassword.getText());
    System.out.println("Number of rows queried = " + n);
    I would like to know if this is the best way of doing a custom query on the Entity Object or is there some other way that i'm missing?

    The best way would be to:
    [list=1]
    [*]Design a view object in JDeveloper which has bind variables for the parameters you need to pass in at runtime. For example, your WHERE clause for your view object would look like:
    LOGIN = :0 and P_WORD = :1[*]Add an instance of that view object definition to your application module
    [*]Write your custom AppModule method like this:
    public boolean authenticateUser(String strLogin, String strP_Word)
      getUsersView().setWhereClauseParams(new Object[]{strLogin,strP_Word});
      getUsersView().executeQuery();
      return getUsersView().first() != null;
    }[list]

  • Where can i find the theory for session and call transaction method

    hi
    where can i find the theory for session and call transaction method
    bye

    check this link
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.planetsap.com/bdc_main_page.htm
    lsmw, bapi, bdc- session, bdc-calltransaction
    u can get it in help.sap.com also

  • Calling PL SQL Procedure in Application Module Method

    Hi Experts,
    I want to know how can i call a plsql procedure in Application Module and get the value of the OUT parameter of procedure . if possible please provide some example
    Thanks in advance.

    Have a look at this sample code from one of our projects:
        CallableStatement cstmt = this.getDBTransaction().createCallableStatement(
          "{ call Expand_Message( ?, ?, ? )}", DBTransaction.DEFAULT);
        try
          cstmt.setString(1, arg1 );
          cstmt.setString(2, arg2 );
          cstmt.registerOutParameter(3, Types.VARCHAR);     
          cstmt.execute();
          result = cstmt.getString(3);
        catch (SQLException e) {
          // Process eventual SQL exception here
        finally {
          try {
            cstmt.close(); }
          catch (Exception e) {;}
        }This code is part of a method in a custom ApplicationModuleImpl class (defined for one of the ApplicationModules) and the 3rd parameter of the Expand_Message procedure is an OUT-parameter.
    Dimitar

  • Calling a method within an application?

    Hi I'm a student taking an intro Java class and right now I have to develop and application that prompts for someone to input a character of the alphabet and it will display the corresponding number on a telephone that it is listed under. The main method gets the input from the user and we are required to retrieve the corresponding digit to the character from a separate method using either a switch statement or a nested if-then-else statement to determine what the digit is. I'm having trouble calling that method in the main class which is another requirement. any suggestions?
    public class Hmwk08
         * Main driver begins program execution.
         * @param args program arguments
        public static void main(String[] args) throws Exception
            char letter;
            char ch;
            int relatesTo;
            PrintStream win = new PrintStream(System.out);
            Scanner in = new Scanner(System.in);
            String newLine = System.getProperty("line.separator");
            win.println("Given a letter of the alphabet, this program" + newLine
                        + "will tell you the corresponding digit on a" + newLine
                        + "telephone keypad.");
            win.println();
            win.print("Enter a letter: ");
            letter = in.nextLine().charAt(0);
            letter = Character.toUpperCase(letter);
         * Get the digit on a telephone keypad that corresponds
         * to the specified character. If the character is neither
         * a letter nor a digit, this method will retun the
         * asterisk character: '*'
         * @param letter the specified character
         * @return the corresponding digit
        private static char getPhoneDigit(char letter)
            char digit;
            digit = '*';
            if(letter == 'A' || letter == 'B' || letter == 'C')
                digit = '1';
            return digit;
    }

    Your method is static so you can call your method without creating a Hmwk08 object.
    char result = getPhoneDigit(letter);Would suffice in your main method
    Mel

  • Job is failing with the following error- Error calling a method of the tree

    dear SDNers,
    my question is where do i need to look for error.
    Will this be an ABAP issue?
    Please guide
    DETAILS
    In SM37 when we see the job XYZ, we get the following details.
       Job                              Ln    Job CreatedB    Status          Start date     Start time      Duration(sec.)     Delay (sec.)
      XYZ                                                                    Canceled        16.11.2009    10:11:30                  9                         27
    When the job log is checked this , we get the below details.
    The job XYZ is failing with the following error.
    Date      Time     Class  No.   Message
    +----
    +----
    2009/11/16 05:03:01 | 00     516 | Job started
    2009/11/16 05:03:01 | 00     550 | Step 001 started (program RBDMON00, variant
    SBCI287, user ID ABCDEF)
    2009/11/16 05:03:03 | TREE_C 000 | Error calling a method of the tree control
    2009/11/16 05:03:03 | 00     518 | Job cancelled
    Equest your assistance in knowing where to find the error for this.
    I have no clue as to where and how i need to debug or where i should i be looking for error.
    In BD87, the selection screen paramters that are given are changed on date (from and to) and IDOC status 51,66,69 and 64 and the message type is "Öutbound interface of picked shipments"
    Please guide.
    Regards,
    SuryaD.
    Edited by: SuryaD on Nov 23, 2009 5:36 PM
    Edited by: SuryaD on Nov 23, 2009 11:14 PM

    > 1. There is a job name ABCDEF
    > 2. When this job is run then the status shows cancelled and the job error log shows tHe details that "error calling a method of the tree control"
    > 3.ThIs error also points fingers to /link to BD87 as seen in the job log " (program RBDMON00, variant \SBCI287, user ID KRISF)"
    >
    BD87 is an IDOC processing.
    > My question to you Sampath.
    >
    > in order to answer your question on whether it is ALv or SALV.. please tell me as to how will i know which progrm is associated with the job ABCDEF?
    >
    Go to sm37 - double click on the job that was failed - Click on Step (on application tool bar) to get the program name - double click on the program name - new popup will be opened - then copy the program and variant
    Go to se38 - enter the program - execute (F8) - choose the variant that is there in the background job - run in forground first
    if the run is good - then check the program - SE38 - Display the program then see
    I just saw the above message BD87... .if that is true, you dont have to do all these
    I dont think it is possible to schedule a job with BD87. Is this the first time or is any job completed without errors for this?

  • How to expose and call AM methods from plain java (testability etc)?

    Hello,
    my project is just starting out with the OA Framework. We just encountered our first hurdle - I hope someone here can help out or at least point me in the right direction. None of this stuff seems to be explicitly mentioned in the standard OAF documentation.
    This is the situation: We need to call the logic in our Application Modules directly. Two reasons for this:
    - We need to expose methods in the AM as web services
    - We really want to create unit\integration tests (probably JUnit) and set up some sort of continous integration environment (Cruisecontrol or similar).
    Now, how do we go about this? I see that controller code usually does something a la this:
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    This doesn't seem viable for plain javacode, since there is no pageContext or web beans in that situation.
    Now, I allready tried the most naive approach (tried it in the OAF Tutorial):
    EmployeeAMImpl employeeAMImpl = new EmployeeAMImpl();
    This of course doesn't work, since none of the VO\EO seem to be instantiated, db connection is probably not set up etc.
    The third approach is the one I found in the javadoc for OAApplicationModuleImpl:
    // load some basic properties
    Properties properties = loadProperties();
    javax.naming.Context ic = new InitialContext(properties);
    // 'defName' is the JNDI name for the application module
    // definition from which the root Application Module is to be created
    String defName = "abc.xyz.SampleApplicationModule";
    oracle.jbo.ApplicationModuleHome home = ic.lookup(defName);
    return home.create();
    This seems more promising this far, however I need help with the following two questions:
    1: Do I really need to go through JNDI to access my AMs from plain javacode (JUnit tests, webservices etc)? If not, how do I then instantiate AMs, complete with EOs, VOs etc?
    2: If I do need to go through JNDI: what is the easiest way to register and subsequently call my AMs and their logic\context, particularly for usage from web services and testing frameworks (JUnit etc)?
    I'm kinda stumped here, guys. How have you solved this, if you haven't then how would you go about doing it?

    Hello,
    my project is just starting out with the OA Framework. We just encountered our first hurdle - I hope someone here can help out or at least point me in the right direction. None of this stuff seems to be explicitly mentioned in the standard OAF documentation.
    This is the situation: We need to call the logic in our Application Modules directly. Two reasons for this:
    - We need to expose methods in the AM as web services
    - We really want to create unit\integration tests (probably JUnit) and set up some sort of continous integration environment (Cruisecontrol or similar).
    Now, how do we go about this? I see that controller code usually does something a la this:
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    This doesn't seem viable for plain javacode, since there is no pageContext or web beans in that situation.
    Now, I allready tried the most naive approach (tried it in the OAF Tutorial):
    EmployeeAMImpl employeeAMImpl = new EmployeeAMImpl();
    This of course doesn't work, since none of the VO\EO seem to be instantiated, db connection is probably not set up etc.
    The third approach is the one I found in the javadoc for OAApplicationModuleImpl:
    // load some basic properties
    Properties properties = loadProperties();
    javax.naming.Context ic = new InitialContext(properties);
    // 'defName' is the JNDI name for the application module
    // definition from which the root Application Module is to be created
    String defName = "abc.xyz.SampleApplicationModule";
    oracle.jbo.ApplicationModuleHome home = ic.lookup(defName);
    return home.create();
    This seems more promising this far, however I need help with the following two questions:
    1: Do I really need to go through JNDI to access my AMs from plain javacode (JUnit tests, webservices etc)? If not, how do I then instantiate AMs, complete with EOs, VOs etc?
    2: If I do need to go through JNDI: what is the easiest way to register and subsequently call my AMs and their logic\context, particularly for usage from web services and testing frameworks (JUnit etc)?
    I'm kinda stumped here, guys. How have you solved this, if you haven't then how would you go about doing it?

  • I deleted a contact out of my iPhone 4S but when I go to send a message the contact appears although that individual is no longer in my address book. I deleted all text and call history pertaining to the deleted contact but still shows up.

    I deleted a contact out of my iPhone 4S but when I go to send a message the contact appears although that individual is no longer in my address book. I deleted all text and call history pertaining to the deleted contact but still shows up. Does anyone have the same issue and how do I fix it?

    dam122577 wrote:
    but wont restoring as new delete all my info on my phone
    Yes. That is why I added...
    it will disappear over time due to non-use.

  • Calling a method in the backing bean when rendering a table

    I'm rendering a table that begins with :
    <h:dataTable value="#{showRooms.rooms}" var="rowRoom" ...
    There are several properties I'm displaying. Some are just displayed as they appear from the database like:
    <h:outputText value="#{rowRoom.roomNumber}"/>
    However, some I need to translate so they display a more meaningful message to the users. For example, status is stored 'A', or 'NA', but this should display 'Available' or 'Not Available'. To do this, I'm taking an idea I saw in another forum by providing a method to call and translate the text. For example:
    public String getDisplayedStatus(String status) {
    if (status.equals("A") {
    return "Available";
    } else {
    My problem is how can I invoke a method and pass in the current value of status for that row in the table. I think I need something like this:
    <h:outputText value="#{showRooms.getDisplayedStatus(#{rowRoom.roomStatus})"/>
    But that doesn't work. I can invoke the getDisplayedStatus method when passing in a hardcoded parameter, but it won't translate the value of both expressions(the method and the method param). How can I achieve this?
    Thanks,
    Mike

    Yes. I've done that and it does work....sort of. It works as long as I refer to it as 'displayStatus'. It looks up the getDisplayStatus and returns a value. The problem is getting the current status value from the object in the List. For example, the 3rd row in the table has either 'A;' or 'NA' for status. I need to know this value in order to do my translation. The way I see it, I either need
    1.)a way to call a method on the backing bean and pass the value of status from the current row into the method.
    -or-
    2.)in getDisplayStatus, I need a way to access the current row's value, perhaps through an expression. This appears to be what you can do in the AbstractPageBean class that all backing beans inherit in Studio Creator. I've seen code in a getter like 'getValue(#{currentRow.status}'), but I don't know how that is done. I looked for the source to AbstractPageBean on the web but couldn't find it - maybe its not open-source.
    Anyway, please share if anyone has a solution. I'm sure this has been done before.
    Thanks,
    Mike

  • Calling a method in the view controller from the component controller

    Hi
    Is there anyway to call a method in the view implementation from the component controller??
    Thanks
    jack

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • Error while updating data using session and call transaction method

    Hi all,
        i have to update data using MM01 transaction from flat file to database.i have used both session method and call transaction method to do that.in both the methods data has been transferred from internal tables to screens but while updating the data that is by clicking the ok-code at the end of the transaction iam getting a dialogue box stating
       SAP EXPRESS DOCUMENT "UPDATE WAS TERMINATED" RECEIVED FROM AUTHOR "SAP".
      please tell whether the problem lies and solution for that.
                                       thanks and regards.

    hi,
    check your recording.check whether u saved your material no in recording or not.
    once again record the transacton mm01.
           MATNR LIKE RMMG1-MATNR,
           MBRSH LIKE RMMG1-MBRSH,
           MTART LIKE RMMG1-MTART,
           MAKTX LIKE MAKT-MAKTX,
           MEINS LIKE MARA-MEINS,
           MATKL LIKE MARA-MATKL,
           BISMT LIKE MARA-BISMT,
           EXTWG LIKE MARA-EXTWG,
    these are the fields which u have to take in internal table.
    this is the record which i took in my flatfile.use filetype as asc and hasfieldseperator as 'X'.
    SUDHU-6     R     ROH     MATSUDHU     "     001     7890     AA
    i did the same.but i didn't get any error.

Maybe you are looking for

  • 13" MacBook Pro abruptly shut down, won't power on or take a charge

    Today I was using my 13" MacBook Pro, bought March 2012 (I think it is running 10.7.5), it had been plugged in all day and the charger light was green.  The screen abruptly went black and all sound stopped working.  As this happens sometimes, I tried

  • I have a new Nano and I get a message that says the USB device is not recognized by my computer and I cannot set it up.

    I have a new IPod Nano and when trying to connect to my PC for the first time I get a fault message that says the "USB Device is not recognized by my computer. I have several other IPod devices and have never had this problem. When I go to windows ex

  • Calling LabView from ASP or PHP ?

    Hi; I was wondering if someone could help me. I need to control a spectrum analyzer remotely.. The VI's are ready, and I would Like to call/Run them from ASP/PHP in order to enable the remote client to interact with the VI's via a normal Web Browser.

  • Please help - Invalid project file.

    Hi, Was about 90% done on a major DVD project when DVD studio Pro 4 crashed. When I try to reopen the file it says "invalid project file". Although I have all of the assets and could rebuild I was in the process of adding subtitles manually and reall

  • IPhone freezes every time i hit home

    Updated to 1.1.1 last night. Today I experience constant freezes everytime I use "Mail" or any other App. A couple of times it's spontaneously reboots. I;ve had to hard reboot everytime I check email!!!! I want 1.0.2 back again. Anyone else experienc