Multiple queries happeing in adf query component using LOV

Hi,
I am using a programmatic view object in adf query component and have created List of values for one attribute by adding another programmatic ViewObject as ViewAccessor.
To populate the lov ViewObject, i have overwritten the method executeQueryForCollection in which i call the webservice to fetch the data. So lov is working fine inside QueryComponent.
I have overwritten queryListener attribute of query component in my backing bean. In the queryListener method, to populate the result grid, am populating the view object by using createRow and insertRow apis. While doing so, Whenever i do setAttibute for the lov field, the overwrittern method executeQueryForCollection getting invoked. Hence my webService getting invoked. So if i have 10 rows, the webservice is getting invoked 10 times.
I put sops in the executeQueryForCollection method for the queryMode and getName.
System.out.println("executeQueryForCollection::::"+this.getQueryMode()); i get as 7
System.out.println("executeQueryForCollection:::=" +this.getName());    i get as  CurrencySummaryLOVVO_5708_findByVC_   The number 5708 varies for every row.
Please tell me How to avoid invoking the executeQueryForCollection everytime when i do setAttribute.
One workaround i have currently is to have one dummry attribute for the lov which can be used for display in grid and actual attribute will be used in Query Component for the lov to function.
Is there any other better workaround?
Thanks a lot in Advance.
Vivek
Edited by: Vivek Singh on Oct 22, 2009 9:16 PM

When you set a value to LOV field it tries to validate it from the LOV data. thats why it execute query.
Try setting Row Level Bind Values = false for the accessor.
yet, i would suggest to find an other way to populate values of LOV since the executeQueryForCollection will be executed many times when you use that LOV:
[http://adfbugs.blogspot.com/2009/08/lov-execute-query-many-times.html]

Similar Messages

  • Programmtically Setting View Criteria in ADF Query Component

    I have created two view criterias for a View Object and used ADF Query component for searching. User can select any one of the View Criteria from "saved search" in ADF Query component. but i want to set it programmatically based on some business rules. How i can do that?

    No I don't want to set view criteria on search click. Actually I have ADF Query component on my page which is by default disabled. There are also some fields outside the query component on the value of which i enable ADF Query component and wants to set a particular ViewCriteria based on context. All ViewCriterias are defined and listed in "saved search" of ADF Query component but i don't want to allow user to select it but wants to application set it automatically based on context. For it i will be needed to set a particualar ViewCriteria for ADF Query component through code and then refresh ADF Query component to show newly set ViewCriteria. I know how to refresh query component or any other component through code but don't know how to set ViewCriteria on ADF Query component?

  • Refreshing ADF Query Component after changing some property of a criteria

    Hi All
    Use Case : Refreshing ADF Query Component after changing some property of a criteria attribute.
    I have a query panel with 2 query criteria i.e. FirstName and DepartmentId where in DepartmentId is a drop down. The scenario is like when change the value of DepartmentId to 'Finance' with code value of '100' then my criteria attribute 'Firstaname' should be invisibe(queriable=false).
    Approach: Have overriden the queryOperationListener of adfquery as " queryOperationListener ="#{backingBeanScope.backing_queryLstener.processQueryOperation}" "
    My backing bean method goes as below :
    public void processQueryOperation(QueryOperationEvent queryOperationEvent) {
    // Add event code here...
    if( queryOperationEvent.getOperation().equals(queryOperationEvent.getOperation().CRITERION_UPDATE) ){
    DCBindingContainer bindings = (DCBindingContainer)this.getBindings();
    DCIteratorBinding iter =bindings.findIteratorBinding("EmployeeView1Iterator");
    ViewObjectImpl voimpl = (ViewObjectImpl)iter.getViewObject();
    ViewCriteria vc = voimpl.getViewCriteriaManager().getViewCriteria("EmployeeViewCriteriaDemo");
    Row currRow = vc.first();
    System.out.println("Department :"+currRow.getAttribute("DepartmentId"));
    if( (Integer)currRow.getAttribute("DepartmentId") ==100 ){
    AttributeDef[] attrs = voimpl.getAttributeDefs();
    int attrIndex = voimpl.getAttributeIndexOf("FirstName");
    ViewAttributeDefImpl attrDef = (ViewAttributeDefImpl) attrs[attrIndex];
    attrDef.setQueriable(false);
    // AdfFacesContext.getCurrentInstance().addPartialTarget(getQryId1()); //here i need to refresh the query component which is not happening
    // refreshQueryComponent(getQryId1());
    Everything is happening as expected but the query panel s not get refreshed.When i refresh the whole link/page then i can see the change.
    Please suggest.
    Thanks in adv.
    -Sanjeeb

    Hi,
    can's say anything about the first part of the question as more insight to the implementation would be required. However, have a look at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/83-bidi-synchronization-tree-form-401841.pdf, which may be what you are looking for
    To the second part: You can programmaticallly refresh the tree component from a managed bean. So instead of using the declarative PPR option (or ChangeEventPolicy set to PPR on the iterator binding) you can wire the submit button to the managed bean, perform your validation and if it fails don't refresh teh tree
    The call is
    AdfFacesContext.getCurrentInstance().addPartialTarget(the_tree_instance)
    Frank

  • Query component using toplink.

    Hi,
    I am trying to implement query component with toplink entity. Please provide any document or sample application related to this.
    Thanks in advance.
    Vamsi

    Have you tried a simple search (http://www.oracle.com/pls/as111210/search?word=toplink) which get you http://docs.oracle.com/cd/E24382_01/user.1112/e17455/dev_toplink.htm#OJDUG1094
    Timo

  • Queries related to ADF Train Component, Region disable if 'No data Found' from URL service

    I have below few queries. I am using JDeveloper version : 11.1.1.6.0
    1. Train Component : I need to remove link which is on 'Train Stop' icon so user can't directly go to next stop.
    2. Hide region in case of Empty Result from URL Service Call :
         I have created a region  and in region put the task flow which have readOnly table calling URL Service data control.
         In case of empty result from service call, table is rendered and displays 'No data to display.' I don't want to show empty table in this case. and I also want to make region invisible (rendered=false).
    3. alternative of <optgroup> tag in adf: Do we have any alternative option to display <optgroup> tag in adf ?
    Regards,
    Niraj

    1. Train Component : I need to remove link which is on 'Train Stop' icon so user can't directly go to next stop.
    You can reference a managed bean from the view activity train definition to enable/disable stops dynamically:
    http://www.oracle.com/technetwork/issue-archive/2011/11-sep/o51adf-452576.html
    ADF Code corner has more train examples, just search for "train" : http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html
    2. Hide region in case of Empty Result from URL Service Call :
         I have created a region  and in region put the task flow which have readOnly table calling URL Service data control.
         In case of empty result from service call, table is rendered and displays 'No data to display.' I don't want to show empty table in this case. and I also want to make region invisible (rendered=false).
    The af:region is out of scope for the table. Instead use a dynamic regions that you switch to from a managed bean (see the product documentation about dynamic regions) and then you switch to an empty region when there is no values to display. Another option would be to hide the table instead of the region using its display property. Let me know which approach you go with and if you need additional information
    3. alternative of <optgroup> tag in adf: Do we have any alternative option to display <optgroup> tag in adf ?
    an af:switcher would do the same
    Frank

  • Scripts/multiple queries in one CF Query block in Oracle

    Greetings:
    I am primarily an MS SQL programmer and I am wondering how to
    run multiple query statements inside a single cfquery block. For
    example, on MS SQL I can do multiple delete statements, or an
    update and select within one cfquery block, but I get an error
    whenever I try to do this on ORACLE. Is there a way to accomplish
    this on ORACLE?
    thanks!

    Your best bet would be to use multiple CFQUERY tags within
    CFTRANSACTION tags if you want them all to be handled in a "block"
    or "session". Or, put all of your SQL statements in a PL/SQL stored
    procedure.
    Phil

  • Parse for multiple occurences of something in query string used

    HI
    A varchar is passed as an input to a stored proc. This could have zero, one or more occurances of a word (e.g. from_no). This will be in form of a name value pair and could occur multiple times. Exampe
    query_string = ' abc=123 and from_no > 1 and from_no < 10 and def = 1'
    Now I need to parse this string to get the operator and values for the 2 occurences of from_no. How can I do that? How can I go about writing a smple func or sp to parse and return both from_no's?

    Perhaps this sample code can help:
    with yourtable as
    (select ' abc=123 and from_no > 1 and from_no < 10 and def = 1' query_string from dual union all
    select ' abc=123 and from_no = 2 and from_no != 30 and def = 1 and from_no=40' query_string from dual)
    select  query_string,
            x.n no,
            regexp_substr(query_string,'from_no *[<>!=]* *[0-9]*',1,x.n) exp,       
            regexp_replace(regexp_substr(query_string,'from_no *[<!>=]* *[0-9]*',1,x.n),'.*from_no *([<!>=]*) *([0-9]*).*','\1') op,
            regexp_replace(regexp_substr(query_string,'from_no *[<!>=]* *[0-9]*',1,x.n),'.*from_no *([<!>=]*) *([0-9]*).*','\2') val
    from yourtable,
         (select rownum n from dual connect by rownum<=100) x
    where regexp_instr(query_string,'from_no',1,x.n)>0   --  end searching in query string when there are no more expressions
    order by query_string, x.nI added one more example.
    It works with your example, but you will have to adapt the code for your real environment.
    This code supports only the operators: =, !=, <, >
    This code supports only numeric values without decimal-point.
    Edited by: hm on 19.10.2010 22:46

  • Execute Query by using LOV (List Item)

    Hello Everyone,
    I did research on how to use List Item with Query but i am still confused since i am a new to the FORM.
    I have created a form where user enters
    Start Date: -- this field user can just type the date
    End Date: -- this field user can just type the date
    Violence: -- this is my List Item (Drop down Menu) where user select the code
    once they select the parameter i have created "Execute" button and it will give number of violence within the date range. the query is giving me right number or violence but then i need to drill down to details.
    so i created a trigger when user double click on the number ( result number) it will pop up another window and display the details
    For example:f_name, l_name, ssn etc...
    Now, my problem is when i double click on (Text Item) it. Its not giving me the number of records that i have get when i execute at the first by using date range and violance code.
    This is the step that i have use:
    when user click Execute button the PL/SQL code:
    Query_step1(:start_date,:end_date,:violations);
    when user double click on Text Item once they have the number this is what i have used code for PL/SQL
    begin
         go_block('xxhc_hearings_rpt_v');
         set_block_property('xxhc_hearings_rpt_v',default_where,'hearing_result = '||'''TERMINATE'''||'and violation '||''||:violations||''||'and propose_term_dt between '||''''||:start_date||''''||' and '||''''||:end_date||'''');
         execute_query;
    end;
    So please anyone can give me little direction that will be a great help.
    Thank You.
    Keyun

    Use the system variable LAST_QUERY to check that you SQL is valid. Assign it to a temp field in the block and check it out.

  • Execute Multiple Queries on Screen Load: ADF Swings

    how can i execute multiple queries and populate each query value to corresponding combo box .assume i what to execute 5 different query and populate it into 5 different combo box.
    Prakash

    Hi,
    if you work with ADF then all iterators are accessible through the panelBinding object
    DCIteratorBinding dciter = (DCIteratorBinding) panelBinding.get("Iterator Name");
    dciter.execute();
    If you need to add query parameters like bind parameters then a call to the execute with params method (if available in the binding) could be perfomed as an OperationBinding
    OperatioNBinding oper= (OperatioNBinding ) panelBinding.get("ExecuteWithParams");
    oper.getParamMap().put("bind variable name", <value>);
    oper.execute();
    Frank

  • ERROR WHEN USING JHEADSTART TO GENERATE ADF BUSINESS COMPONENT FROM DESIGNE

    Use JDeveloper to generate a ADF Businness component using Jheadstart from
    Designer the following error is thrown
    oracle.jmig.source.ExtractorException: Caught SQL exception:ORA-01795: maximum number of expressions in a list is
    1000
    at oracle.jmig.source.designer.DesignerExtractor.extract(DesignerExtractor.java:136
    at oracle.jmig.MigrationRunnable.extract(MigrationRunnable.java:349)
    at oracle.jmig.MigrationRunnable.migrate(MigrationRunnable.java:183)
    at oracle.jmig.MigrationRunnable.run(MigrationRunnable.java:122)
    at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
    at java.lang.Thread.run(Thread.java:595)

    Yes, this is a known issue. We will fix this for the next release.
    Having said that, the next release will contain the JHeadstart Forms2ADF generator which directly reads Oracle Forms .fmb files to ADF, without the need to use Oracle Designer, avoiding problems like this alltogether.
    Steven Davelaar,
    JHeadstart Team.

  • How to programatically populate data in ADF shuttle component?

    Hi,
    Can anyone please let me know the code for programatically pouplating data into the shuttle Oracle ADF shuttle component using ArrayList object? I have my data(records) in an Arraylist object and I am using JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660.
    Thanks,
    Vikas

    Have a look at this thread:
    http://baigsorcl.blogspot.com/2010/10/creating-shuttle-component-in-oracle.html
    Thanks,
    Navaneeth

  • Multiple Queries in Workbook - Refresh Screen Shows Up for Every Query

    We have multiple queries in a workbook.  All of these queries have the exact same selections for the variable selection screen.  When all the queries are refreshed once, the selection screen used to show up once and all the queries are refreshed with the same selections.  
    We were on BI 7.0 and SP10.  We recently moved to SP12.  Since the SP12 installation, the multiple query refresh pops-up the selection screen for every query.  It is nothing like "multiple query refresh" at once since the user has to click "execute" button for every single query.  It is interesting to note that the selection screen only contains hierarchy variables and hierarchy node variables.  The other variables of selection screen do not show up.  I couldn't find any OSS note on this topic.  Please let me know if anyone has any comments on this issue.  I will assign points to useful posts.

    hi Sameer,
    try to update front end patch to latest version ?
    Using the BI 7.x Add-On for SAP GUI 7.10 - Requirements
    hope this helps.

  • How to use ADF Query search with EJB 3.0

    Hi,
    In ADF guide http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/web_search_bc.htm#CIHIJABA
    The steps to create query search with ADF Business Components says:
    "+From the Data Controls panel, select the data collection and expand the Named Criteria node to display a list of named view criteria.+"
    But with EJB, I'm not able to find Named Criteria node. Can we use ADF query search component with EJB? If yes, can you please show me some example, tutorial etc.?
    Thanks
    BJ

    For EJBs you'll need to implement the query model on your own.
    An example of how the model should look like is in the ADF Faces components demo.
    http://jdevadf.oracle.com/adf-richclient-demo/faces/components/query.jspx
    Code here:
    http://www.oracle.com/technology/products/adf/adffaces/11/doc/demo/adf_faces_rc_demo.html

  • ADF Shuttle Component - Can we have multiple leading list

    Hi,
    I have requirement where there are multiple lists of different types on the left hand side and user should be able to shuttle the items from any of the list to the single selected list in right side. I know in ADF shuttle there is one leading and one trailing list. I wan to know how can i make ADF shuttle component support multiple leading lists and single trailing list.
    Or should I go for total custom solution mimicking shuttle behavior?
    JDev version is 11.1.1.6.0
    Thanks,
    Sandeep
    Edited by: Sandeep Koul on Aug 26, 2012 10:47 PM

    After consulting other ADF experts offline, we have come to conclusion that there is no off-the shelf component which caters to my requirement.
    We are now going with complete custom solution to achieve shuttle behavior.
    I am marking this query as answered.
    Thanks,
    Sandeep

  • How to use my Declarative Component in query component ???

    Hi everybody,
    I want to change inputDate in query component to my declarative component for Date fields. I did not find any way except implementing the Model of Query component so read "Web User Interface Developer’s Guide for Oracle Application Development Framework 11g Release 1 (11.1.1) " document and use the ADF Faces Demo Application. now I don't know can I change type of search component to my declarative component in DemoQueryBean class ??
    the code of oracle.adfdemo.view.query.rich.DemoQueryBean that I changed is :
    public static final ComponentType myDatecomponent=ComponentType.valueOf("myDate");
    private void _createPageDef()
    _pageDef = new DemoPageDef();
    _pageDef.addAttributeDef("Ename",
    "Employee Name",
    "Full name of the Employee [Last Name, First Name]",
    String.class,
    persianDate,
    false, null, true, true, true);
    As you can see I changeed type of Employee Name component to my Component but I see below exceptions :
    ]] Root cause of ServletException.
    java.lang.ExceptionInInitializerError
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         Truncated. see log file for complete stacktrace
    java.lang.IllegalArgumentException: No enum const class oracle.adf.view.rich.model.AttributeDescriptor$ComponentType.myDate
         at java.lang.Enum.valueOf(Enum.java:192)
         at oracle.adf.view.rich.model.AttributeDescriptor$ComponentType.valueOf(AttributeDescriptor.java:121)
         at oracle.adfdemo.view.query.rich.DemoQueryBean.<clinit>(DemoQueryBean.java:52)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         Truncated. see log file for complete stacktrace
    >
    I think these exceptions happend because of there is not any constant of AttributeDescriptor$ComponentType in ComponentType class for myDate component.
    I try to create a class and extends ContentType and add my component type to it but I can't. is there any way for solving this problem ?
    please help me :(
    Thanks.

    Hi,
    saying it this way: There is no native option to do this. Since I never tried hacking into the framework classes, I can't say if there is a glimpse of hope for you
    Frank

Maybe you are looking for

  • Can two different accounts coexist in messages?

    My wife and I have separate accounts for our iphones and computers. We share a third computer. On the third computer, I installed messages beta. I entered my account info (same as computer and iphone). Is there a way for my wife to enter her info ind

  • Resume procedure execution after Exception Handler

    Hi -- Can anyone tell me how to resume execution of my procedure if and when I fall into the Exception Handler? I'm in a for/loop and i want to move to the next record after falling into the exception handler. Thanks, ~Christine

  • UnsatisfiedLinkError when using berkeley db in java

    Hi, I downloaded the Berkeley db version 5.1.19 and wanted to use java to access the db. However, when constructing the Environment object, an exception was thrown: Exception in thread "main" java.lang.UnsatisfiedLinkError: E:\java\Test\libdb_java51.

  • HT4623 unable to connect to any wifi

    unable to connect to any wifi

  • Advice Needed for Training

    Hello Everyone: I searched the web site and couldn't find a good answer for my question.  I am about to restart the web site design component of my marketing and public relations business after a unexpected two year break.  I am in need of some train