ADF how can i execute a query with parameters when the page renders

hi
i am using ADF web 11g
i need to execute a query with parameters when the page renders
thanks

hello,
I'm a fan of Java code, I really am.
But when you use ADF, you decided to move to a more declarative environment.
So why not do it declarative, the adf way?
In your pagedef insert a action binding.
This can be anything, a call to the application module, a call on the iterator(Like executeWithparams, etc.)
Create an invokeAction in your pagedef and set the condition.
This example refreshes(Action 2 is execute query) the data.
First the method binding:
    <action IterBinding="PersoonIterator" id="Execute" InstanceName="LSAppModuleDataControl.Persoon"
            DataControl="LSAppModuleDataControl" RequiresUpdateModel="true" Action="2"/>And the invoke action
    <invokeAction Binds="Execute" id="refreshData"/>This always refreshes the data on page entry, but anything is possible, you can set condictions for the invokeAction.
-Anton
PS Yes I know that pagedefs become backing beans in the end and yes that is Java code, but if you wanna play the ADF way, the goal is the reduction of Java code and the increased performance of declarative programming.

Similar Messages

  • How do I stop a query from running when the page is loaded

    Hi All,
    I'm using JDeveloper 10.1.3.4. I have a JSPX page that is used to collect search parameters and then when a button is clicked uses those values to run a query and then populate a table on the same page. The problem is that when the page is loaded the system attempts to run the query. The query is a method in a session bean. I can keep the method from running the query code by wrapping it in an 'if' statement and checking the parameters for null (or other value). Once the parameters are collected the query is invoked but it looks like the method is running twice, once with the parameters (here I've checked that the result actually has rows in the list) and then again where the parameters are null and the method returns null.
    What is the best way to do what I want here? From the buttons action method I am called the session beam method and returning null to stay on the same page. I think that is why the method is running the second time and returning null.
    TIA,
    Dave

    Have a look at these screen casts from Steve Muench and see if one of these techniques works for you, or gives you the clue you need.
    Creating Three Simple Search Pages with ADF Business Components and ADF Faces (JSF)
    Part 1: Web-Style Search Form
    Part 2: Oracle Forms-Style EnterQuery/ExecuteQuery Mode Page
    Part 3: Search Form Using View Object with Named Bind Parameters
    I had trouble viewing these with Firefox, but they worked in Internet Explorer.

  • How can I create a query with web service data control?

    I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.

    Hi,
    This might help
    *054.     Search form using ADF WS Data Control and Complex input types*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

  • How can I execute a query from a BSP application?

    How can I execute a query from a BSP application?
    I´m trying to execute a Query from intranet. I´ve been looking for examples, but the templates I´ve found doesn´t help me.
    does anybody has an example?
    Thanks.

    Hi
    Have you designed the BSP application ?
    design it first with one page
    page will have layout and Event handlers
    Design the layout with the fields
    in the event handler there are events
    in the event On Initiailization or ON inputprocessing write the select query similar to what we write in routine ABAp and fetch the data into ITAB and that has to be passed to the Layout
    see the doc
    BSP
    To learn how to create Web applications with Business Server Pages, you can work through the simple tutorials that build on each other. You should be able to run through all of the steps described here in your own system.
    If you want to develop Web applications with BSPs, your system must meet the following requirements: Prerequisites for Creating Web Applications.
    The following tutorials are available:
    · First Tutorial: First Steps with Business Server Pages…
    · Second tutorial: A Small BSP Application and A Small BSP Application with HTMLB
    · Third tutorial: Our First Online Bookshop
    · Fourth tutorial: Further Developing the Bookshop
    · A small Tutorial is also available for your first steps with the Model View Controller design pattern.
    · For a more complex MVC tutorial based on the third tutorial, see: Our Little Online Bookshop Using MVC and HTMLB
    When creating BSP applications, note the browser dependencies described in Note 598860.
    steps:
    1) start the transaction RZ10.
    2) now u u have to select Profile name, so select the INSTANCE Profile from the list of options given with the Profile parameter list.U may find multiple instance profile in the list, so select the profile in which ur server name is given.
    3) u will also find three options in the same window.
    Administrator data, Basic Maintenance, and Extended Maintenance. So select the last one from that.
    4) Now click on change button.
    5) here u will find parameter icm/host_name_full, so now set it as FQDN.
    6) Now copy ur settings with new version number.
    7) Activate that version.
    8) And now please restart ur WAS.
    So this will set ur FQDN, and also don't forget to login using Admin User.
    Now u also check for following service are active in your ICF setting or not,( just start transaction code SICF)
    /default_host/sap/bc/bsp/sap
    /default_host/sap/bc/bsp/sap/system
    /default_host/sap/bc/bsp/sap/public/bc
    /def ault_host/sap/public/bc
    /default_host/sap/public/bc/ur
    /default_host/sap/public/bsp/sap/public
    /default_host/sap/public/bsp/sap/public/bc
    /defaul t_host/sap/public/bsp/sap/system
    /default_host/sap/public/bsp/sap/htmlb
    if not then activate all.
    check this link
    Read this weblog...
    /people/brian.mckellar/blog/2003/09/25/bsp-in-depth-fully-qualified-domain-names
    http://www.thespot4sap.com/articles/SAP_WAS_Creating_BSP_Apps.asp
    it consists of screen shots also
    Check it.
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/101c3a1cf1c54be10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/bb153aab4a0c0ee10000000a114084/frameset.htm
    Regards
    Anji

  • How can I create a query with tables in INFOSET?

    Dear Gurus,
    How can I create a query with tables in INFOSET?
    Just tables and fields INFOSET?
    Kind Regards,

    Hello
    Check following SCN Article for your understanding/reference:
    - [Using Infoset Query ,SAP Query and Quick Viewer|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10eab7af-0e54-2c10-28a5-87b47adbe1a5]
    Regards
    JP

  • When using Mavericks, how can I automatically replace 'i' with 'I' when typing?

    When using Mavericks, how can I automatically replace 'i' with 'I' when typing?
    It was easy to do prior to mavericks using system preferences (language and text), but now I can only submit a 2 letter word to replace, not a 1 letter word. I have tried using a space but it doesn't allow that. I would assume that most people would love to be able to type quickly without having to make uppercase I all the time (first world problem i know), so I can't understand why apple have removed this feature.

    There is the shift key, or text replacement approach, providing you have enabled two things:
    Edit > Substitution > √ Text Replacement
    System Preferences > Keyboard > TextClick + to add a replacement
    Replaceii[spacebar]
    With
    I[spacebar]
    Press return
    Quit System Preferences
    Now, when you type ii, you will see a pop-up offering I.
    In the OS X App Store, search for WordService. This free collection of Services will enable you to just type your content, select it, and then choose the Service item, “Initial Caps of Sentences.” It does what it says.

  • How Can I know about any change happened in the page??

    ........... I Use JDev 11g ........
    How Can I know if any change happened in the page???
    for example:
    I have a page and I press a creation button that create a new row in view object I want when I press any button that will call another page the page ask a user Are you want to save changes? before leaving a page.
    Or
    I edit the value in a view object but not committed ( I didn't commit the data in database ) . When I want to leave the page I want to display a message say : Are you want to save changes?
    How can I do that?
    Thank You...
    Sameh Nassar

    Check out http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html Example 60. Do not go by the 'on page load' name... This approach will allow you to plug in your custom code at any 'phase' of your adf life cycle. You can capture any request coming from your page, and check for pending transaction states and act accordingly.. I realize that the reply is a little abstruse, but this is not a drag-drop-smile requirement.. :-)
    http://download.oracle.com/docs/html/B25947_01/bcdcpal005.htm#sm0271
    Julian

  • How can I create a scrolling effect where when the user scrolls down the image will blur out?

    How can I create a scrolling effect where when the user scrolls down the image will blur out?

    Hi there,
    You can create a scroll motion where the image will fade out on scrolling, you need to use the Opacity tab under Scroll Effects Panel.
    If you particularly need the image to be blur out, then you need to edit that image in any image editing program and make one copy of that image as blurred, then place both images (actual and blurred) on that page and use scroll motion or fade option to replace images.

  • How can I execute a Procedure with OUT variable is %ROWTYPE on SQL Prompt

    Hi,
    I have a procedure with OUT variable is %ROWTYPE
    How can I execute the following procedure on SQL prompt.
    (without creating anonymous block)
    CREATE OR REPLACE PROCEDURE zz_sp_EMP(VEMPNO IN EMP.EMPNO%TYPE,
    V_REC IN OUT EMP%ROWTYPE)
    AS
    BEGIN
    SELECT * INTO V_REC FROM EMP WHERE EMPNO = VEMPNO;
    END;
    Thanks & Regards,
    Naresh

    as previous posters said: it's not possible to do this without declaring a variable in the anonymous block.
    With anonymous block it would look like this (had to change it a bit, since i'm using hr-schema on oracle XE):
    declare
    l_rec EMPLOYEES%ROWTYPE;
    begin
    zz_sp_EMP(VEMPNO => 100, V_REC => l_rec);
    DBMS_OUTPUT.PUT_LINE ( 'first_name = ' || l_rec.first_name );
    DBMS_OUTPUT.PUT_LINE ( 'last_name = ' || l_rec.last_name );
    end;
    first_name = Steven
    last_name = King

  • How can I open a document with applescript without the doc. window opening.

    How can I open a document with applescript without opening the document window and speak the text of the document?  I can get it to open the file but the doc window always opens up. 

    try
              set pathToMyFolderOnDesktop to ("Macintosh HD:Users:jodyconnor:Desktop:") & "Dsource:" as alias
              set rnd to (random number from 1 to 6)
              set rndFileName to (rnd as text) & ".scpt"
              set FullPath to pathToMyFolderOnDesktop & rndFileName as text
              set myScript to load script (FullPath as alias)
      run script myScript
    on error the error_message number the error_number
              display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
              return
    end try
    This code answered my question:  Hats off to Digimonk from stackoverflow and Darrick Herewe from stackoverflow.

  • How can I restore my iphone with icloud without the setup assistant?

    How can I restore my iphone with icloud without using the setup assistant? If this is not possible, how do open the setup assistant?

    Settings, general, reset, erase all contenet and settings, then you will restore from icloud.

  • How can I make a table cell extend beyond the page?  The text disappears when the cell becomes larger than the page.

    How can I make a table cell extend beyond a page?  The text disappears when the cell becomes bigger than the page.  I want the table to continue to the next page.

    As a student, you might be able to get Office for Mac from the college bookstore at a substantial discount. Otherwise, I think your best option for documents that need to be shared with Office users is to get one of the free Office clones such as LibreOffice.

  • How can I execute a query using RSCRMBW_REPORT?

    Hi everybody,
    I have read the document:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3ba5e590-0201-0010-59b1-cab51fd245b7
    and found it is very intersting for my requirement.
    I copied the report,and modified it regarding our case.But during the second call,I get runtime error.
    I debugged the code, and found the error results from method GET_CUBETYPE() of class CL_RSCRMBW_BAPI.In this method,it tries to create a object which is TYPE REF TO cl_rsd_dta.
    CREATE OBJECT lr_dta
         EXPORTING
           i_infoprov    = g_s_status-infocube
    But g_s_status-infcube is null.
    I am not able to find where this 'infocube' component  in this g_s_status struction is filled,even I found,I don't know how I can give this infocube parameter from report which 2 FM are called.
    My code is following:
    parameters: p_repuid TYPE RSCRMSTATUS-REPORTUID
    DEFAULT 'Z_IC_01/Z_COMP_Q003'.
    parameters: p_split type BAPI6110DIM-DIM_NAM.
    data:name_query TYPE CHAR50,
         result_table LIKE RSCRMSTATUS-TABNAME,
         it_return LIKE BAPIRET2 OCCURS 2 WITH HEADER LINE,
         infocube TYPE CHAR30,
         compid TYPE CHAR30.
    AT SELECTION-SCREEN  ON VALUE-REQUEST FOR p_repuid.
    CALL FUNCTION 'RSZ_COMPONENT_TREE_GET'
        EXPORTING
          i_title    = 'Query auswählen'(031)
        IMPORTING
          E_INFOCUBE = infocube
          E_COMPID   = compid
        EXCEPTIONS
          OTHERS     = 1.
      IF sy-subrc GT 0.
      ENDIF.
    concatenate infocube '/' compid into p_repuid.
    START-OF-SELECTION.
    CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
    i_mode = 'OPEN'
    i_reportuid = p_repuid
    I_PACKSIZE = 10000
    I_EXECMODE = 'TABLE'
    I_EXTRACT = 'ZBWTEST'
    I_SPLIT = p_split
    I_CLEAREXTRACT = 'X'
    TABLES
    E_T_RETURN = it_return.
    CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
    i_mode = 'START'
    i_reportuid = p_repuid
    I_PACKSIZE = 10000
    I_EXECMODE = 'TABLE'
    I_CLEAREXTRACT = 'X'
    TABLES
    E_T_RETURN = it_return.
    So far this creation of report is only the 2nd step.But I am not sure how step 3 to step 6 should be done so that the report can be execute exactly.
    What should I do? Pleas help me!
    Thanks in advance
    Regards,
    Liying
    Message was edited by: Liying Wang
    Message was edited by: Liying Wang
    Message was edited by: Liying Wang

    Liying
    Were you able to get a solution to this problem? I am facing the same issue too. The g_s_status-infocube is showing blank.
    Regards
    Dilip

  • How Can I Execute Sql Query in Managed bean?

    Hi,
    I want to execute sql query in managedbean and get the query result. How can I do?
    Best wishes!

    You can do this by having current Database connection your application is using like this
    public static synchronized DBTransaction getDBTransaction(){
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data}");
    BindingContext bc = (BindingContext)vb.getValue(ctx.getCurrentInstance());
    DataControl dc = bc.findDataControl("AppModuleDataControl");
    ApplicationModuleImpl am = ((ApplicationModuleImpl)(ApplicationModule)dc.getDataProvider());
    return am.getDBTransaction();
    and then user DBTransaction object to create Statement and PreparedStatement you can find those in java doc.

  • How can we execute a procedure with object type as its parameter, by passing partial elements.

    Can somebody help...
    I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
    PROCEDURE p_save (example IN OUT xyz_obj)
    my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
    And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.

    user13026549 wrote:
    Can somebody help...
    I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
    PROCEDURE p_save (example IN OUT xyz_obj)
    my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
    And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.
    It ISN'T possible. How could it be? Each attribute has to be set to something don't you think?
    A common way to handle that is to define a public package variable that is an instance of the object type and has ALL elements set to null. As Odie suggested a custom constructor function can be used for that.
    Then you create your procedure instance by starting with an instance of the package variable (where everything is null) and setting values for the attributes you need.

Maybe you are looking for