Accessing fields of the af:Query Component

Hi all,
I need to get the value of a dynamic field that is added to the query component at runtime.
In my application there is field named "Member Id" which adds a "select one component" in the advanced search mode.
This "select one component" has a string value "self".
What I need to do is,
When the value "self" is selected from the "select one component" I need to use the Id of the user
as the "Member Id" for the search query.
Is it possible achive this by using af:query component ? or is there a different approch?
I'm using JDeveloper 11.1.1.0.1
Thanks,
Melaka

Melaka,
first create a custom View Object Class for your View Object from the Java Classes pane. Then override the buildQuery() method of the ViewObjectImpl by writing the following code:
@Override
protected String buildQuery(int noUserParams, boolean forRowCount) {
// call super.buildQuery() to allow the framework to build the query
String query = super.buildQuery(noUserParams, forRowCount);
// here you will modify the query
// if the query contains your keyword
if (query.contains("'self'")) {
// replace it with the actual user id
// return the modified query
return query;
I am sure there are other cleaner ways to accomplish this.
Consider for example using two separate attributes: one Transient for your "Member Id" query criteria - what is shown to the user - and another attribute actually mapped to a column that is used for querying. You set the value of the second attribute as the first one changes.
Regards,
Nick

Similar Messages

  • Guide me to override the af:query component QueryListener property

    Hi All,
    If any one have sample application to override the af:query component query lisenere proprety, please share. I have the following requirement in search criteria.
    Field 1
    Field 2
    Field 3
    Field 4
    Field 5
    Find Button
    Result section
    Validations on these fields:
    1. When user enters value in field 1 and tabs out, a background plsql should execute and return the value to field 2. If no value returns, then and exceptio should raise for field1.
    2. Field 3: when the user enters a value and tabs out, it should automatically convert to UPPER case.
    3. Field 5 and field 4 are date paremeters. Field 5 should be disabled until a value enters in field4
    4. Value in field 5 should be validated agaigst field 4 it should always > field 5
    5. Once user hits find button, it should check for atlease one search criteria other wise it should prompt the user to enter atlease one search criteria. (ALong with above 5 validations). Popup should come here.
    Any suggestions would be appricated.
    Edited by: SrinivasA on Jan 28, 2011 4:43 PM

    I'm not sure you'll be able to achieve all of this with the af:query component.
    Here is how to do the dependent lists:
    http://blogs.oracle.com/shay/2011/01/dependent_lovs_in_an_afquery_c.html
    It might be easier to build this type of search form something like executeWithParams - see:
    http://blogs.oracle.com/shay/2009/12/adf_query_with_parameters_and.html

  • Is it possible to use the af:query component with programmatic VOs?

    My understanding is that the view criteria in a normal SQL-based VO are used to add WHERE clauses to the VO.
    Since programmatic VOs do no have this capability, is there something I need to override in the view object implementation class to support the view criteria that will be established by the af:query component?
    Does someone have an example of how this might be done?
    Thanks, -Klaus

    Unfortunately no. The remote control will work, but the radio will not.
    The radio only works with the iPod video and the nano.

  • Aligning fields horizontally in af:query component

    Hi friends,
    i am developing a search region using the named criteria of my VO by dragging it. This created an af:query component in the search region. However the fields are displayed in rows in the search region. I want to align these fields so that all the fields are displayed in a single row. also how can I set the length of the fields.
    Any ideas or hints how to do this.
    Thanks in advance
    Edited by: user9197772 on May 20, 2013 3:58 AM

    Hi,
    Check
    http://www.jobinesh.com/2011/01/customizing-component-display-by.html
    http://docs.oracle.com/cd/E23943_01/apirefs.1111/e12419/tagdoc/af_query.html

  • Sorting of Date field in the SQL Query useing ORDER BY

    Hi
    I am facing a problem when I am getting the results of a query from the ORacle 8i database using jdbc connection.
    The query is having a date field and I have to sort the query results using ORDER By for the Date field. The query is giving exact results in the SQL PLus interface.
    When I am getting this results in the GUI where servlets are being used an Exception is coming as not supported RefreshRow method.
    If anyone has faced this problem and have got the solutions please let me know.
    thanks
    sulfy

    That doesn't sound at all like an SQL problem.
    More like you trying to do updates on the resultset which is not allowed ...
    send a some code (not to much pls :) and we'll be
    able to help more
    cu
    Spieler

  • How to give References for the field in the Abap Query

    Dear Freinds,
               I am not able to get Text for Cost Centre which iam using in My custom infotype , when iam calling the Custom infotype in abap querry i dont find the T symbol for my field Cost Centre , since i have created in my custom infotype for Cost Centre similar to the infotype 0001. When i look at the
    infotype 0001 fields in my abap query i can see that there is T field for P0001-KOSTL and again if i double click on it i can see that in the REFERENCES Tab i can see " Function Module:HR_TXID_KOSTL" . Could any one let me how i can assign to my custom field "Function Module:HR_TXID_KOSTL " in the References Tab.
    Regards
    divya

    solved the problem

  • How to move the fields in the standard webdynpro component.

    Hi ,
          I am new to webdynpro dynpro.
    I have a requirement in which i have to move the standard fields to some other place.
    The webdynpro component isn HRRCF_C_PERSONL_DATA_UI.
    In this i have to move the fields location and poastal code above the fields country and region which comes in ADDRESS .
    First i enhanced the application . then i right clicked the field , but the up menu is disabled since it is a standard one.
    kindly give suggestion to move the fields.
    Thanks & Regards,
    S.Velsankar

    Hi
    You need to delete that UIElement from standard component and create similar new UIElement, Now you can move your UIElement as per  your requirement. if you want to come back to original state of your component, delete your enhancement and the deleted UIElement will be back.
    Thanks
    Vishal Kapoor

  • Can Business Object Access Queries from the BI query designer?

    Hi Gurus,
    I've started working with BOBJ and honestly I'm not impressed with it's functionalities, specially with the report layouts (SO many limitations!!). Anyway I was wondering if Business Objects can access BI Queries in the Query Designer since I can do most of the manupilation in Query Designer that I need. Thank You in advance and any help will be most certainly appreciated.
    - Kit

    Hello KIT,
    Also, look at the below Blog for xcelsius where he directly consumes the BEx query the QUERY_VIEW_DATA Web service out of the BW system. This is one way to approach the BEx query:
    /people/arvind.bhaskar/blog/2009/04/17/consuming-bi-queries-in-an-xcelcius-dashboard
    Thanks
    Arun

  • How to add Column field in the custom Query Link search page as a header

    Hi,
    I have created a Query page link in web layout editor. Now, I want to customise the view of the result. I see an option to change the "Text1" and "text2", but how do I add other fields as a colum in the search result ?
    The only column I see by default Id, Title, release date and author. I want to see some of the custom metadata in the search result. I don't wan't to apply user specific custom search page.
    Overall, I want a common search view across all the user such that each user doesn't have to create a custom search view.
    Please help.
    Thanks

    hi
    By adding context node, you will not be able to fetch value. To fetch value in BTSubject, you need to have following nodes in your context node.
    Node          Relation                  Higher level node
    BTAdminH
    BTBOSSet  BTHeaderBOSSet   BTAdminH
    BTSubjectSet BTSubjectSet_A BTBOSSet
    BTSubject BTSubjectAll  BTSubjectSet_A
    Right now you dont have BTBOSSet and BTSubjectSet in your view. That is why component is unable to pull data in BTSubject.
    My suggestion would be to create cuco with above nodes
    Bind BTAdminH with BTAdminH of Component controller
    and bind BTSubject of details view with BTSubject of your Cuco.
    If you want code code gp catalog as it comes in complaint then there is seperate procedure for that.
    Best regards
    Pankaj Kumar

  • SQL exception thrown while accessing fields through the bean

    Hi All
    This is the SQL Exception that i get when i try to get the data from the database ---java.sql.SQLException: ORA-01008: not all variables bound
    Plz help if u have any idea.
    Thanx and regards,
    Akshat

    It seems like you have set the number of parameters in a PreparedStatement less than the actual number of parameters. This is one possibility.
    Regards,
    $ Carol.

  • Auto suggest behavior for af:query component LOV fields.

    Hi,
    I am new to ADF development and need help on implementing auto suggest behavior to the LOV fields generated by af:query component. For inputList and inputCombo.. fields we can add af:autosuggestbehavior tag to enable this. How do we enable the same for af:query generated LOV fields.
    Regards,
    C.R

    Thanks Timo for such a quick response.
    JDev version we are using is 11.1.1.6.0
    Unfortunately, we have gone too far with the AF:Query and Everything else is working apart from Auto-Suggest on AF:Query. Now will take a lot of time to implement and test. Also, users will have to spend considerable time to test it again.
    Thanks and Regards,
    Satya

  • Adding New Fields to a BEx Query does not show up in the CR field explorer

    This could be a silly question.
    I have a CR report based on a BEx query.  I had to add a couple of new fields to the BEx query, and when i want to add those fields to the CR report, I don't see them even after I do a refresh in the field explorer. 
    How do i see this new fields in the CR report?
    Help Please
    Thanks

    Hi,
    you can open the report and go to the menu Database > Verify Database.
    that should add the new fields to the list of fields in CR
    Ingo

  • Timezone effects on Date and Timestamp fields in af:query component

    Hello,
    I'm working on an ADF application where time zone is configured as follows:
    * Dynamic View Layer time zone is configured in trinidad-config.xml file and bound to a session scoped value:
    <trinidad-config>
      <skin-family>fusionFx</skin-family>
      <time-zone>#{sessionScope.tz}</time-zone>
    </trinidad-config>* ADF BC time zone is configured in adf-config.xml file and bound to View Layer time zone:
    <adf-config>
      <user-time-zone-config xmlns="http://xmlns.oracle.com/adf/usertimezone/config">
        <user-timezone expression="#{adfFacesContext.timeZone.ID}"/>
      </user-time-zone-config>
    </adf-config>The problem here is that Dates and Timestamp values work as expected all over the application except for the af:query component. When displayed as af:inputDate in af:form, Dates and Timestamp values are NOT getting converted to the time zone (TZ) configured in trinidad-config.xml file, whereas TimestampTz and TimestampLtz are. However, when displayed in af:query component, Dates and Timestamp values are automatically converted to View Layer TZ after a search has been performed.
    For example, say View Layer TZ = US/Pacific and we enter 01/jun/2011 as a search criteria of type Date and then click on the Search button. The displayed value automatically changes to 25/nov/2011, that is, it gets converted to the WLS JVM time zone, which is set to Europe/London.
    Is conversion of Date and Timestamps in af:query component the expected behaviour or could this be a bug?
    Is there any way to avoid this conversion?
    Thanks in advance
    Version:
    ADF Business Components 11.1.1.59.23
    Java(TM) Platform 1.6.0_21
    Oracle IDE 11.1.1.4.37.59.23
    PMD JDeveloper Extension 4.2.5.3.0
    Repost on 26-nov-2011 9:29
    Repost on 28-nov-2011 15:10
    Edited by: Barbara Gelabert on 26-nov-2011 9:29
    Edited by: Barbara Gelabert on 28-nov-2011 15:10

    Hi,
    Thanks for your reply. This certainly seems promising. However, I am getting a connection error now.
    The following...
    jar_loaded = require 'ojdbc14.jar'
    puts "Oracle jar loaded? #{jar_loaded}"
    puts "Starting active record"
    require 'rubygems'
    gem 'activerecord'
    gem 'activerecord-oracle_enhanced-adapter'
    require 'activerecord'
    puts "Connecting to MXGN"
    ActiveRecord::Base.establish_connection(
    :adapter => 'oracle_enhanced',
    :host => 'THEHOST',
    :port => '1550',
    :database => 'THEDB',
    :username => 'THEUSER',
    :password => 'THEPASSWORD'
    ... produces
    Oracle jar loaded? true
    Starting active record
    Connecting to MXGN
    ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
    ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
    C:/jruby/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the oracle_enhanced adapter: `gem install activerecord-oracle_enhanced-adapter` (LoadError) (RuntimeError)
    from H:\sandbox\DBPlay\lib\main_enhanced.rb:12
    I'm confused. Am I missing the driver, or have I failed to setup the enhanced Oracle adapter?
    I have tried moving the jar to $JRUBY_HOME/lib too, but the result was the same.
    All help would be greatly appreciated.
    Many Thanks
    Adrian

  • Changing the Infoset Query out put field

    Hi,
      Please let me know can we do the changes for the Input/Output field for the infoset query in PRD. That mean  if some of the fields are hidden and we want to show them at the output can we directly do the changes in PRD .
    Thanks & Best Regards,
      Mahesh

    hi
    Create the infoset with PNP database and add all the infotypes required (including custom ones). Add all fields.. vale, text etc. as seperate fields of the custom Z tables as additional fields in the infotypes and write your code accordingly to select the data into these fields based on the already existing infotype fields. For example if you want to get designation based on position you will write:
    select <designation> from ZDESG
    into <custom field>
    where PLANS = P0001-PLANS
    Creating joins over already existing joins will not be a stable solution.
    thanks & regards
    Satish

  • Query regarding : af:query component

    In af:query my requirement is to add one search field which looks like :
    "*Label*" "*Drop down List*" "*Input Text field*"
    For the other fields which have only
    "Label" and one other Component type i am using QueryDefinition.addAttributeDefinition But how to add two components with Label.

    Not sure if you can change the af:query component to do this , but you can easily build your own search form and in this form build your own layout.
    http://www.youtube.com/watch?v=osdR6I2YVEQ&feature=player_embedded#! this video give you an example
    Timo

Maybe you are looking for