Execute Method Before Detail VO is Refreshed

Hi all,
JDeveloper 11.1.2
I have two entity based view objects with master-detail relationship defined by a view link. The detail view object is based on an advanced Oracle database view, which needs a database procedure to be executed before it can be queried.
Besically, I want to execute a method when master view object current record is changed, before detal views are refreshed.
Is this possible? As an ADF noob, I see lots of methods to override, but which one?
I hope you can help.
Regards,
Håvard

Haavard,
This is a use case I've never run across before, so my "answer" here is really just thinking out loud (I've not tried).
First, you'll have to make sure that your View Object isn't based on an Entity Object (I'm guessing), otherwise the EO cache may get in the way of refreshing the VO.
Perhaps you could have a read of [url http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/bcadvvo.htm#sm0341]this part of the docs, which tells how to do a programmatic VO to get some ideas. What I would probably try first is overriding executeQueryForCollection() to first call the stored procedure and then call super.executeQueryForCollection().
Again, not tried/tested, so something for you to try out :)
Edit - Timo and I posted about the same time - his idea seems promising, too.
Best,
John

Similar Messages

  • JDev 11.1.2.1 Execute method (with bind variable) before page is displayed

    Hi All,
    I have a view object with a query that uses a bind variable. I drag the data control onto my .jsf page to create a table. I create a query method on a view scope bean. The query method uses the contents of one of the bean's attributes to set the bind variable for the query:
    vo.setNamedWhereClauseParam("CraIdBindVar", sessionBean.getCraId());
    I place a button on the page that invokes the query method and it populates the table. This is fine but I don't want the user to have to click on the 'query' button when they navigate to this page. I have found forums that discuss creating an AMImpl.jave method, creating a binding on the page, creating an executable for the binding. This works in that the method is executed before the page is displayed. However, the AMImpl method cannot call sessionBean.getCraid() to get the necessary data item to populate the bind variable.
    Is there a way to execute my view scope bean method before the page is displayed? Or perhaps a way for the AMImpl.java method to access the view scope variable?
    Thanks, Steve

    Steve,
    you can drag a method call activity onto the task flow. Then select the new method call activity and open the property inspector. Here you select the method from your bean in the method property. Now you first navigate to this method call activity and then to the page.
    Timo

  • Execute a method before a page is displayed?

    I love JSF, but I have continuously run in to a wall trying to figure out how to execute code before a page is displayed. Is there some Listener/Binding mechanism that I could tap into that would be called before Render Response?
    A Phase Listener is too general, I don't want something that walks the tree for every request.
    Action/ValueChange Listeners are only called after a user takes an action.
    Putting calls (for example DAO) in getter methods works in some circumstances, but is fragile and is insufficient when you need to populate multiple fields on a bean but only want one (DB) call. (You can put it on the first one that will be called, but this destroys reusability).
    The only sucessful strategy I have found is having an init() that returns boolean and calling it from the first <h:outputText> on the screen's render field. This is obviously a painful hack.
    This is a general question, but my current scenario is a single DB lookup needs to get a list of beans before a page is displayed. (users can link directly to the page). Once the lookup is complete the list of beans is displayed in 3 seperate data tables with 3 seperate action bindings. So it doesnt really make sense to do the db lookup in one get method that populates the 2 other lists, though it would be a functional approach.
    Any thoughts?

    I love JSF, but I have continuously run in to a wall
    trying to figure out how to execute code before a
    page is displayed. Is there some Listener/Binding
    mechanism that I could tap into that would be called
    before Render Response? In vanilla JSF? No.
    In JSFTemplating: yes.
    It provides an "initPage" event which is invoked every time a page is "initialized" (which may be a long time before it is displayed). It also provides an <event> component which includes a "beforeEncode" event which is invoked during renderring.
    A Phase Listener is too general, I don't want
    something that walks the tree for every request. I agree.
    Action/ValueChange Listeners are only called after a
    user takes an action. Yep.
    Putting calls (for example DAO) in getter methods
    works in some circumstances, but is fragile and is
    insufficient when you need to populate multiple
    fields on a bean but only want one (DB) call. (You
    can put it on the first one that will be called, but
    this destroys reusability).Exactly.
    The only sucessful strategy I have found is having an
    init() that returns boolean and calling it from the
    first <h:outputText> on the screen's render field.
    This is obviously a painful hack.Yep.
    This is a general question, but my current scenario
    is a single DB lookup needs to get a list of beans
    before a page is displayed. (users can link directly
    to the page). Once the lookup is complete the list of
    beans is displayed in 3 seperate data tables with 3
    seperate action bindings. So it doesnt really make
    sense to do the db lookup in one get method that
    populates the 2 other lists, though it would be a
    functional approach.The "events" I mentioned above for JSFTemplating allow any # of parameterized "handlers" to be invoked. "handlers" are more reusable than #{} method bindings due to their support for multiple inputs and outputs. You also do not have to do any faces-config.xml file configuration, they are defined via Java SE 5 @annotations.
    If you want examples or help trying this out... let me know. JSFTemplating pages can be mixed with JSPs as well... although once you start using JSFTemplating pages, you're not likely to make any more JSP pages.
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net
    Any thoughts?

  • Calling a method before entering a page

    Hi,
    What is the best way for calling a method before entering a page in ADF, when this page is the fist page that user in enter into it in Application, I mean there is not any other page before this page ( in this case I am able to call that method in task flow with method call).
    Also, I want this method calls only one time....
    Thanks.
    Edited by: Amir Khanof on Jun 29, 2010 5:19 AM

    Hi,
    one option would be to add a method for the afterPhase property of the f:view component on a JSPX page and listen for the after restore phase. Then check if the request (you get this from the FacesContext) is a GET request, which indicates that the page was requested from the browser and not in the process of navigating in the application. If the conditions are true, access the method and execute it
    Frank

  • Can we call a method before and after Export operations in ADF 11g

    Hi,
    My problem is I have to execute a method before and after the export operation.Is this posible in ADF 11g
    Regards,
    Felix

    Hi,
    in response to a similatr post of yours, I replied
    1. Drop af:exportCollectionActionListener on a command button
    2. set the command button to display = false
    3. In your Java code, call
    ActionEvent ae = new ActionEvent(button);
    ae.queue();
    Everything you put before
    ActionEvent ae = new ActionEvent(button);
    ae.queue();
    will fires as a pre-trigger, everything after as a post trigger
    Frank

  • Decision step with method before workitem execution

    I have a decision step, which uses method before workitem execute uses BO Bus2094 - 'Display' method.
    When an agent receives a workitem, try to execute the workitem 'Getting an information message 'Error when starting submethod'.
    When i see the information of the error -
    "At least one submethod could not be processed.
    See the technical Workflow log to determine the error cause."
    When i check technical log of workitem, 2 steps are in error mode.
    1.  Dialog work item executed - Error when starting submethod
    2. EXECUTE_METHODS  - System error in asynchronous method start
    This is happening in Quality system, not in DEV system.
    Any inputs to resolve this.

    Hi,
    @Sivagami: I wonder, how a container element e.g. BUS2094 that was passed to a copy of the DECISION task is automatically executed just before the decision dialog? Good stuff, if it works like this, I'll try this at a later time.
    @Indira: Depending on the Release and such things I have expirienced several smaller bugs regarding the decision steps, especially when extending the data flow (from/to workitem), using the in-place-decision Workitem exit. So maybe you're already doing everything right, but just the inbox doesn't works as designed.
    To work around this problem, you could enter the object methods as a secondary method, which then will display the Sales document in a separate window,
    or you follow the proposal of Sivagami. If the Sales document doesn't seem to appear, you could enforce the display, by globally substitute the business object DECISION to one of your own, re-define the object's method Process that read the business object fromt the work item container and executes it's display method, which is basically the same result you'd like to have.
    Best wishes,
       Florin

  • How to call AMImpl method before loading the page(task_flow_config.xml)

    Hi experts,
    I have requirement like,
    I need to call AmImpl method, before rendering the page.(I heard like we can do it in task_flow_config.xml by using method_Invoke operation,But I am not sure about How it is going to work, also i need to know the implementation part,,,help pls )
    (I need to do in Task_Flow.)
    Inside that method I have some logic, where I will setting the BindVariable of my one ViewObject and I need to run the ViewOblect,So that DataShuold be available while page loading.
    I have some different logic after that,,,,
    can anyone suggest me for this??
    thanks
    Santosh

    thanks to Timo n TK,
    I have use case like,
    In the search page I have 2 LOV dropdowns say LOV1 and LOV2. Both list of values are created based on the independent View Objects based on the Query.
    LOV2 VO query is having the Bind Variable, for that Bind variable will be getting the value from the one of the AM method based on the user logged in.
    Also I need to display LOV2 dropdown in the page when user selects LOV1 as a 'SCM', for others it should be in hidden state.
    As per requirement I have to display LOV2 only for LOV1 value as 'SCM'. So I dont want to use valueChangeListner() for this.
    Instead I want populate LOV2 value before page rendering(because in that time i will be having all the parameter to populate ) by executing LOV2 VO Query.
    Once in search page user selects LOV1 as 'SCM', I should display 'LOV2' values in the dropdown.
    If i execute LOV2 VO in the AMImpl method say A() before page rendering ,then if user select LOV1 as 'SCM', will same data available in the dropdown (LOV2 dropdown is based on the LOV2VO)??
    Can u pls suggest me how can i render ,LOV2 when LOV1 as 'SCM' by using 'rendered' property without having valueChangeListner??
    pls suggest me the right approach as per my use case..
    waiting for reply,,
    Thanks
    Santosh

  • Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain

    Hi All,
      I have created a custom web part in VS 2008 for Share point server 2010 with DevExpress v12.2.17, and deployed as Sandboxed solution. when i add that web parts in web part zone i am getting the error as "Web Part Error:
    Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. ".
    If there is any way to get detailed error either log file or event viewer.
    Kindly advice to find the cause of the problem.
    Thanks,
    Selvakumar.S

    Hello,
    Are you impersonating your code? Have you tried to debug your code by attaching SPUCHostService.exe? if not please do so.
    You also need to check ULS log for more information about this error. Here is one ref link if this could help
    http://sohilmakwana.wordpress.com/2013/11/29/sandbox-error-unhandled-exception-was-thrown-by-the-sandboxed-code-wrappers-execute-method-in-the-partial-trust-app-domain/
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Using value selected in selectOneChoice as variable for execute method

    I have already created data controls for the session bean method so I can drag and drop on to the jsp. This works fine when entering the data into the input text fields but I really need the first value to come from an initial page and the second value to come from the dropdown. I just don't know how to get the value or how to connect it to the button for execution.
    The method takes two values
    value 1, org is passed in (how do I pass from another page? I will actually have the render for this input field set to false so it does not display)
    value 2, typeId from a selectonechoice drop-down list (how do I manipulate the soc to pass the information? Currently it looks as if it is just passing the elementAt number, I need get the actual value for the item selected. Where can I retrieve it?)
    I have a button ready to execute the method on the session bean which should take these values. (of course the inputvalue for the soc was not typeId but I changed it. The values for the soc are actually coming from another method performed earlier.)
    This is what I have so far:
    I have my input text field waiting on info to be populated from the previous page (currently I manually entered it)
    I have my selectonechoice populated
    A button with the execute method already set (b/c I initially used the drag-drop functionality to test my method)
    Forgive me for repeating myself so much.
    Thanks!

    Passing a value between pages:
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/af_lifecycle.htm#BABIHDAA
    Getting a value from a list item:
    http://www.oracle.com/technology/products/jdev/tips/mills/listvalue/listbindingvalue.html
    http://blogs.oracle.com/shay/2009/11/getting_the_value_from_a_selec.html

  • Execute() Method is undefined

    Hi all.
      I am developing a WebDynpro Application which will use a EJB for business logic. I am using a javabean as interface between EJB ane WebDynpro. I created a instance of model in webdynpro and i am trying to retrive the data from backend. But in webdynpro, while writing the execute() method, it displaying that execute() method is undefined for this type.
        Kindly give some suggessions to rectify this.

    Hello Pavan,
    Is your EJB Bean which is having execute method is in classpath ? Is those Home interface and all are in Proper place?
    Thx & Rgds
    SS

  • How can I find the source of report in the executable method= "Spawned" ?

    Dear all:
    how can I find the source of report in the executable method=>"Spawned" ?
    Regards,

    Hi,
    Please see this thread.
    To View Spawned Concurrent Program Source Code
    To View Spawned Concurrent Program Source Code
    Regards,
    Hussein

  • What are the operations we can do on incoming message in execute() method of pipeline component?

    Hi,
    Actually I am new to BizTalk and not getting idea about how to process message in execute method?
    Thanks in advance

    Hi Rocky,
    You can have any kind of processing done (logic applied) on the incoming message and produce output message and only restriction is implementation of the interfaces.
    As you are new to BizTalk, I suggest to go through following articles for better understanding and insight:
    http://blogs.msdn.com/b/brajens/archive/2006/11/25/how-to-develop-biztalk-custom-pipeline-components-part1.aspx
    http://blogs.msdn.com/b/brajens/archive/2006/12/03/how-to-develop-biztalk-custom-pipeline-components-part2.aspx
    http://tech-findings.blogspot.in/2013/10/custom-zipreceivepipeline-to-unzip.html
    Maheshkumar S Tiwari|User Page|Blog|BizTalk
    Server : How Map Works on Port Level

  • IDocumentQuery.Execute() method throws user does not have edit permissions exception

    I'm trying to query a document folder for all of its containing documents. Its a basic query like this:
    IPortletContext PortletContext = PortletContextFactory.CreatePortletContext(Request,Response);IRemoteSession PTSession;PTSession = PortletContext.GetRemotePortalSession();IDocumentManager documentManager = PTSession.GetDocumentManager();
    IDocumentQuery documentQuery = documentManager.CreateQuery(FolderID); documentQuery.SetSortProperty(ObjectProperty.Name);IObjectQuery queryResults = documentQuery.Execute();
    When I'm logged into the portal as an administrator, everything works fine. However if I'm logged in as a "regular" user, I get this exception when calling the Execute() method:
    Plumtree.Remote.PRC.PortalException: Exception of type Plumtree.Remote.PRC.PortalException was thrown. ---> System.Web.Services.Protocols.SoapException: Server was unable to process request. --> Access denied: Current user does not have edit permission
    I'm sending the Login Token to the portlet. Now I've tried giving the user Edit rights on the document folder as well as Edit the Knowledge Directory rights in the Activity Manager, but neither gets rid of the exception. I'm not sure what other "Edit" permissions to check. I don't even see why the user would need "Edit" permission to anything in the first place since the Execute() method simply returns an IObjectQuery that doesn't have any ability to make changes to any objects. I know that I could use the SearchFactory interface, but I wanted the results to be real time. Any help would be much appreciated. Thanks!
    Jimmy

    The problem here is that the query is created with default settings to show unapproved documents -- only users with edit access can see unapproved documents. Add the bold line to your code and it will work.
    IDocumentManager docManager = prcSession.GetDocumentManager();IDocumentQuery docQuery = docManager.CreateQuery(iFolderID);docQuery.SetShowUnapproved(false);IObjectQuery queryResults = docQuery.Execute()

  • PreparedStatement and execute() method

    Hi to all.
    I would like to understand a thing.
    Why the execute() method gives me back false also if the SQL instructions is well executed?
    Is this right?
    TIA
    Omar

    Returns:
    true if the first result is a ResultSet object; false if the first result is an update count or there is no result
    http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html#execute()

  • How can I execute method of Component for name

    Hello,
    My program has JInternalFrame with some components. Write me please - how can I execute method of Component for name of Component ?
    Like this:
    ... findObject("jTextArea1").cut();
    Thank you in advance.

    just cycle through the container's components until
    you find one where getName equals "jTextArea1"Thank you for your answer.
    I'm creating components in runtime (I add panel+JTextArea in JTabbedPane) and I don't know how many components will be in JTabbedPane.
    I know only it's names.
    I wan't to execute metod JTextaRea_n_.cut() via using JTextaRea_n_.Name.
    How ?

Maybe you are looking for

  • Please help - Copying items to another folder?

    I thought I was pretty good with Automator, but I've never done a folder action before, and I can't seem to get this one to work. I want to have any songs in my "Automatically add to iTunes" folder automatically copy themselves to my mom's "Automatic

  • HTML report looks different than REPORTS PREVIEWER

    I am having a weird problem with my reports. My reports look just fine in the Oralce Reports Developer live previewer. However when I look at the Report Server generated HTML format of the same report, the label on the right side of the page gets tru

  • Photoshop elements 11 please help?

    setup this is the message I get . The following application are using files that need to be updated by this setup. Close these applications and click retry to coninue: Adobe Bridge CS5 (bridge.exe) Iog off, and restread. this did not work what next?

  • Cannot download pdf files with adobe

    I still have the same problem I had a month ago I cannot download pdf file from internet sites screen just goes black I have recently upgraded software to lion I have the latest adobe software installed still no joy. Was never a problem in the past o

  • Embed tag and validation

    I am using Dreamweaver to place .swf into my page. It generates an embed tag which never passes W3C validation. How do I place a .swf and still be compliant with the standards?