Call view object from ViewController [SOLVED]

I'm using a valueChangeListener method in a managed bean, which I'd like to use to call a method on a view object. How can I call the view object from a managed bean class?
Regards

Maik,
It is best practice to create a method on your application module, and have this method manipulate VO's and call VO methods.
See section 8.5.3.1 in ADF Developers Guide for more info o calling an AM method from a managed bean:
http://download-west.oracle.com/docs/html/B25947_01/bcservices005.htm#sthref673
Please use the JDeveloper forum in the future for question like this, that are not related to JHeadstart.
Steven Davelaar,
Jheadstart team.

Similar Messages

  • How to execute Custom java data source LOV view object from a common mthd?

    Hi,
    My application contains Custom java data source implemented LOVs. I want to have a util method which gets the view accessor name, find the view accessor and execute it. But i couldn't find any API to get the view accessors by passing the name.
    Can anyone help me iin how best view accessors can be accessed in common but no by creating ViewRowImpl class (By every developer) and by accessing the RowSet getters?
    Thanks in advance.

    I am sorrry, let me tell my requirement clearly.
    My application is not data base driven. Data transaction happens using tuxedo server.
    We have entity driven VOs as well as programmatic VOs. Both are custom java data source implemented. Entity driven VOs will participate in transactions whereas programmatic VOs are used as List view object to show List of values.
    Custom java datasource implementation in BaseService Viewobject Impl class looks like
            private boolean callService = false;
        private List serviceCallInputParams = null;
        public BaseServiceViewObjectImpl()
            super();
         * Overridden for custom java data source support.
        protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams)
            List dataFromService = null;
            if(callService)
                callService = retrieveDataFromService(serviceCallInputParams);
            setUserDataForCollection(qc, dataFromService != null? dataFromService.iterator(): null);   
            super.executeQueryForCollection(qc, params, noUserParams);
         * Overridden for custom java data source support.
        protected boolean hasNextForCollection(Object qc)
            Iterator<BaseDatum> datumItr = (Iterator<BaseDatum>) getUserDataForCollection(qc);
            if (datumItr != null && datumItr.hasNext())
                return true;
            callService = false;
            serviceCallInputParams = null;
            setFetchCompleteForCollection(qc, true);
            return false;
        }Individual screen developer, who want to load data to VO, will do something like the below code in their VO impl class
        public void fetch()
            BaseServiceViewObjectImpl vo = this;
            vo.setCallService(true);
            vo.setServiceCallInputParams(new ArrayList());
            vo.executeQuery();
        }As these custom java data source implemented LOV VOs comes across the screens, i want to have a util method at Base VOImpl class, that gets the view accessor name, finds the LOV VO instance, retrieves data for that. I want to do something like
         * Wrapper method available at Base Service ViewObject impl class
        public void fetchLOVData(String viewAccessorName, List serviewInputParams)
            // find the LOV View object instance
            BaseServiceViewObjectImpl lovViewObject  = (BaseServiceViewObjectImpl) findViewAccessor(viewAccessorName);
            // Get data for LOV view object from service
            lovViewObject.setCallService(true);
            lovViewObject.setServiceCallInputParams(serviewInputParams);
            lovViewObject.executeQuery();
    Question:
    1. Is it achievable?
    1. Is there any API available at View Object Impl class level, that gets the view accessor name and returns the exact LOV view object instance? If not, how can i achieve it?

  • Java access to view objects from uix page provider

    I have a java method called from a uix page as follows:
    <dataScope>
       <provider>
           <data name="frameworkTableData">
              <method class="smart.FrameworkAspects"
                      method="getFrameworkStudyAspects"/>
           </data>
       </provider>
    I want the java program to be able to access the bc4j view objects defined on the page. These are:
    <bc4j:registryDef>
      <bc4j:rootAppModuleDef name="SmAspectsBrowseAppModule"
                             definition="smart.Smartbc4jModule"
                             releaseMode="stateful" > 
       <bc4j:viewObjectDef name="SmFrameworksBrowse"
                        rangeSize="0"  />                       
      <bc4j:viewObjectDef name="SmAspectsBrowse"
                          rangeSize="10" />                       
      <bc4j:viewObjectDef name="SmStudyMembersAspectsEdit" />
      </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    I've read through several of the threads on using Configuration.createRootApplicationModule(amDef, config) and it is not clear what it is looking for in the arguments.  It appears that "config" is the name of the app module. I don't know what the amDef relates to.
    Anyway, I can't get it to work.  All I'm trying to do is get at 3 view objects I have defined in my bc4j section and am having trouble getting this to work.
    Any ideas on how to approch this would be much appreciated.
    Thanks, Steve
    Does anyone                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Can you explain how you solved the problem? I have the same. Thanks.

  • New to JavaFX--Calling Java objects from JavaFX

    Hello,
    I am a Java developer who is new to JavaFX. I am having no luck in finding a tutorial that exhibits more than just fun effects. I need to be able to call existing classes from a JavaFX GUI. Can anyone offer any assistance on this? It's very frustrating because this should be a simple task. If we are faced with having to rewrite existing code, we will probably be forced to abandon JavaFX. I hope this is not the case.
    Thanks!

    The answer is yes. The impementation is -
    If you have classes that you keep as library classes that you intend for use irrespective of the platform, then I suspect that you have already written them with no view content. For those, including them in your JavaFX is not really different to using them in Java. I am just learning JavaFX too and the most important lesson for us to learn is that 'JavaFX is Java with FX on the end of it'. I know the strickly come dancing set will say 'oh but what about types'. Well I have found no trouble at all with types, basic or my own, we are in object world so long as the compiler has the class object and we have all stuck to the rules then it has all it needs to act on your objects.
    So your non-View classes can be used as you always use them -
    import mylib'
    var somethingFromMyLibOfClasses = new mylib.ClassThatDoesSomethingVeryClever();
    It is then just a matter of arranging a FX trigger of some kind (trigger/event/timer/bind) to call the function in your library.
    Which triggers and when are the part I am still finding difficult. The basic GUI events are fine (onMouseClick etc), it is 'bind' that is troublesome.
    Binding something in your code to a 'property' of the display element is easy enough, but binding where you have no external variable that relates to 'Property' value is less clear. For example you may have to change a form contents due to a trigger sent from a remote database.
    You have some in the forum talking of 'resize your window a few pixels to force a redraw so that your code can be retriggered'. Others are using timers at high tick frequency to for an update. such as changing a property that you can't see.
    That is utter nonsense, if you look up the proper description of bind then it becomes obvious. Bind can be a two way thing, you can change a value in your element from outside, but you can also change a value outside of your element from within your element.
    Equally that trigger can be your own code. There is no need of trickery to update Scenes, the writters of JavaFX already have it sussed.
    The Sun web site has some great tutirials, but as a personal favourite that cleared up som of the junk about JavaFX that was building up in my mind I reccommend you spend a bit of time here [JavaFX Refference|http://openjfx.java.sun.com/current-build/doc/reference/JavaFXReference.html]
    Not the best layout you will ever see, but it is the best source I have found, then if you use that along side [Master Index|http://java.sun.com/javafx/1.2/docs/api/javafx.stage/javafx.stage.Stage.html] hopefully you will find, as I did, that you do not have to think differently to make use of the FX on the end of Java.

  • Error in Creation of a New View Object from Existing Entites

    I define a Complex JOIN in the expert mode of the View Object Creation Mode. On trying to access the VO, the system returns an error, unable to creat View Objecy.
    THe SQL Statement begins with
    SELECT * from ( select ...My actual Query)
    Is it possible to define ur own view objects with the same flexibility as the Data Tables

    Hi Saket,
    Following will be required for created a custom business object.
    1. Object Type - ZTEST (Internal Techincal Key)
    2. Object Name - ZTESTNAME (Technical Key Name)
    3. Name - TEST (Name of BO, it is used while selecting the object type)
    4. Description - (Short Description of BO)
    5. Program - ZTESTPROGRAM (ABAP program in which the methods of the object type are implemented)
    6. Application - A or B.. etc (Area to which your BO is related)
    Please remember that you can learn these basic things by giving F1 help on those fields and in HELP.SAP.COM.
    Regards,
    Gautham Paspala

  • ADF - Accessing view object from a button in a window

    Hi
    I am using Jdeveloper 10.1.3.2.0 to build a Swing/ADF application.
    I added a method to a view class to call a database procedure.
    I use that view as a base of a jTable to display data in a window.
    Now I need to call the method that I created in the view class from a button on the same window where I display the data, ideally using the same db connection.
    I am quite new to ADF and I have no idea how to get a reference to the view instance in the button method to call my new method. How can I do that? Is there another way to achieve this?
    Thanks!
    Luis

    You usually do this by creating the method at the application module level and then exposing it as a client method. You can then drag and drop it onto your form as a button.
    See details in the ADF Developer Guide chapters 8.3-8.5:
    http://download.oracle.com/docs/html/B25947_01/bcservices003.htm#sm0206

  • How to call View Method from ComponentController ?

    Hallo Experts,
    Is there a possibility to call a method of View(Controler) from the ComponentController ? Component is still the same.
    Greetings
    Wojciech

    Hi Wojciech,
    as already said by Gopi, the methods of the view should not be called outside the view! Of course you could store a reference to the view inside the comp_controller, but the right way is to inform the the views in case of changes! Just use events to notify view about changes and trigger changes inside the event-handler (which are inside the views).
    Best regards,
    Stefan

  • Setting bind variable for a view object from the Managed Bean

    Hi,
    i am using JDeveloper 11g, i have to create LOV in the JSF. To show the LOV, it has to populate data using View object and its query parameter need to be sent from the Managed Bean.
    For the View object i want to set the bind variable parameter from the managed bean value. bename is stored in a managed bean (session scope)
    #{beantest.bename}
    But it gives the following exception.
    JBO-29000: Unexpected exception caught:
    org.codehaus.groovy.control.MultipleCompilationErrorsException,msg=startup failed, Script1.groovy: 1: expecting '!',found '{'@ line1, column 2.
    I have followed the link http://kr.forums.oracle.com/forums/thread.jspa?threadID=615474 like Frank wrote on 8.2.2008:
    But steps are not clear.
    How to input the VO bind parameter with Managed bean variable?
    Any Help
    Regards
    Raj
    Edited by: user9928180 on Dec 17, 2008 9:51 AM

    Hi,
    a bind variable in a VO needs to be exposed as an executeWithParams operation in the pageDef file. Just add a new action binding to the pageDef file (context menu) and select the executeWithParams operation on teh VO. Then in the argument field, reference the managed bean property for the value
    Frank

  • Create view link between two view objects (from programmatic data source)

    Hi Experts,
    Can we create a link between two view objects (they are created from programmatic datasource ; not from either entity or sql query). If yes how to create the link; ( i mean the like attributes?)
    I would also like to drag and drop that in my page so that i can see as top master form and the below child table. Assume in my program i will be only have one master object and many child objects.
    Any hits or idea pls.
    -t

    Easiest way to do this is to add additional transient attributes to your master view object, and then include those additional transient attributes in the list of source attributes for your view link. This way, you can get BC4J to automatically refer to their values with no additional code on your part.

  • Procedure to Call Workflow Object from ABAP program in Se38

    Hi All,
    I have one scenario like i have to call one Workflow object from ABAP program in SE38.The scenario is like below.....
    I have to select some records from database table.For example there are 100 records in the internal table.
    For all that records i have to invoke Workflow for getting approval from the authorized persons. Once Approval has come to program, It will post one document in SAP and process ends.
    Please suggest me how to move forward with this scenario.
    Regards
    Manas Ranjan Panda

    Hi,
    So you want to start a workflow from an ABAP, if an event exists for that particular workflow then the best way is to use fm SAP_WAPI_CREATE_EVENT,
    to start a workflow from an ABAP you can use fm SAP_WAPI_START_WORKFLOW.
    Kind regards, Rob Dielemans

  • Call View Method from Componentcontroller?

    Hello @all,
    how can i call a view method from the componentcontroller?
    Regards
    Chrisp

    Hi Chrisp,
    Which method of the view you want to call from component controller. It is always better to create methods in component controller or custom controller to use in different views that inhance perfomance for views.
    Hope it helps
    Regards
    Arun

  • Call view method from componentcontroller method

    hello,
    how can i call a view method from componentcontroller method?
    thanks
    marcus

    Hi Marcus,
    As you said instance of view is already there when you are creating component controller's instance. So you work is done. You have to have event handlling mechanism.
    1. Create an event in your componentcontroller (Used component).
    2. Have a interface method in the same component controller. Now from you component you can call this method right.
    3. In the implementation of this interface method fire the event which you have created in step 1.
    4. Write eventhandler for this compnent's event in the view where actuall method is.
    So the moment u will call interface method of component it will fire component's event and it turn this event will be caught by the event hadler u have written in view.
    5. Now in implementation of this view's eventhandler call the view's required method.
    And job is done.
    Only thing event hadler of view will work only in case view is initialized in memory. As you said you have the view instance so no probs..
    Ask in case of any doubt.
    Regards,
    Neha Modi

  • CALLING BUSINESS OBJECT FROM AN ABAP REPORT

    Hi friends,
               I have a business object to which a Custom Function Module is assigned in one of its method.This Function Module calls a Bapi to update a Service Order.I need to capture the status of Idocs regarding success or failure from the function Module in the ABAP Report.I would like to know if there is any way to call this business object from my report and get the status of IDOC.
    Regards,
    Dev Reddy

    sorry I think i was not clear in explaining .I am calling a BAPI to update 'Priority' field of service orders in a custom function module(remote enabled) and I have assigned this bapi to a custom business object. Also I have developed an ALE interface thru BDBG transaction which automatically generates custom basic idoc type,messsage type ,Ale i/b and o/b function modules.
    Actually my requirement deals with a report where we have list of service orders in an internal table and pass each service order to update Priority field.
    Is there any way to create an IDOC from the report and update the priority field and pass back the status of IDOC.
    I have tried calling ALE O/B function function module generated thru BDBG transaction in my report but as a result i am unable to get any of the message whether idoc is created or not.
    Here is my report code.
    data: it_methods type table of BAPI_ALM_ORDER_METHOD with header line,
          it_header type table of BAPI_ALM_ORDER_HEADERS_I with header line,
          it_header_up type table of BAPI_ALM_ORDER_HEADERS_UP with header line,
          RECEIVERS TYPE TABLE OF BDI_LOGSYS WITH HEADER LINE.
    T_METHODS-REFNUMBER = '000001'.
    IT_METHODS-OBJECTTYPE = 'HEADER'.
    IT_METHODS-METHOD = 'CHANGE'.
    IT_METHODS-OBJECTKEY = '000004000768'.
    APPEND IT_METHODS.
    CLEAR IT_METHODS.
    IT_METHODS-REFNUMBER = '000000'.
    IT_METHODS-METHOD = 'SAVE'.
    APPEND IT_METHODS.
    IT_HEADER-ORDERID = '000004000768'.
    IT_HEADER-PRIORITY = '2'.
    APPEND IT_HEADER.
    IT_HEADER_UP-ORDERID = '000004000768'.
    IT_HEADER_UP-PRIORITY = 'X'.
    APPEND IT_HEADER_UP.
    CALL FUNCTION 'ZZ_FM_SM_ORD_PRIOR_UPDATE'
    EXPORTING
       OBJ_TYPE                      = 'ZBOSMPRUPD'
       SERIAL_ID                     = '0'
      TABLES
        ITMETHODS                     = IT_METHODS
        ITHEADER                      = IT_HEADER
        ITHEADERUP                    = IT_HEADER_UP
        RECEIVERS                     = RECEIVERS
      COMMUNICATION_DOCUMENTS       =
      APPLICATION_OBJECTS           =
    EXCEPTIONS
       ERROR_CREATING_IDOCS          = 1
       OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks,
    Dev Reddy

  • Create view object from

    I create temporary table and I have to create view object and display data from that object. After that I have to delete temporary table.
    How to do it?
    Thanks!

    Check out the createViewObjectFromQueryStmt() method of the Application Module.
    See:
    http://www.oracle.com/technology/products/jdev/tips/muench/mostcommon/index.html#vo

  • Access to a method located in view object from JSP page?

    Hi,
    How can i access a public method which is loacted in view
    object "viewobjectImpl.java" from JSP page.

    Juan,
    Either via Data tags or/and Java embedded code.(<%...%>).
    This method, suppose to execute a stored procedure.
    Thanks

Maybe you are looking for

  • Getting error while importing

    Hi Guys, I'm gettig below error while importing the request.I have checked info objects and DSO's  in source and target systems all were in active version.Please give your inputs why i'm getting like this. InfoObject ZEMC_FRSC is not available in ver

  • Partial Qty delivery error

    Hey guys.. I'm plagued with this problem and haven't found a solution yet so I'd thought I'd come the experts: We routinely ship partial qty's per delivery line to customers if they choose.. ie- SalesOrder is for 3 widgets and we only have 1. We'll s

  • Adv. Pricing: Custom Attribute mapped to Std. Volume's ITEM_QUANTITY field

    Advanced Pricing: A Custom Attribute is mapped to Std. Volume's ITEM_QUANTITY field, to be able to capture a user-defined volume onto the Standard Quantity field via. Attribute Mapping. However the expected behavior is not achieving. Still the PTE pr

  • Set context privilages issue

    Hi I create a procedure but get this error. CREATE OR REPLACE package body SearcProduct_Pkg  is procedure SearchProVar(PCode in varchar2, Storeid in number,Usertype in varchar2) is begin dbms_session.set_context( namespace => 'paramsNew1', attribute

  • Condition in SD

    Hi, SD Gurus, The client is going to sell a material for a specific period. In that specific period for the particular material he wants to have a discount if the customer purchase 10 Quantity to 20 Quantity he his eligible to buy the material for Rs