How to supply values for searchCriteria items in af:query programmatically

Hi,
Is it possible to supply the default values for search criteria items in af:query programmatically? I didn't find any of the method to set the values for the search criteria items inside the oracle.adf.view.rich.model.Criterion and oracle.adf.view.rich.model.AttributeCriterion classes.
Please let me know how can I supply DATE values by default for the search criteria items inside the view criteria.
Thanks

Jdev I am using is 1.5.
I've search page where I've a date field (like TransactionDate). The transactionDate is a transient variable in my VO. Created a view criteria using this transient date filed and kept the operator as 'Between'. When I load the page, I want to keep the values for Between operator as 'CurrentDate' and 'CurrentDate - 365 days' (LastYearDate as of today).
I can't use bind variables to set the currentDate and lastYearDate to the values of the 'Between' operator. If I use so, I will get an error 'Attempt to set a parameter that doesn't occur in the sql.....'.
So I thought of overriding the QueryEvent inside the bean. But I didn't find a way to set the values for the TransactionDate programmatically.
I tried below code in the queryEvent method, but in this case the response time is very hign ( I didn't see the result till 30mn).
DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
ViewCriteria vc =
JUSearchBindingCustomizer.getViewCriteria((DCBindingContainer)bc.findExecutableBinding("SupplierSearchCriteriaQuery"),"__ImplicitViewCriteria__");
Date curretYearDate = null, lastYearDate = null;
Calendar calendar = Calendar.getInstance();
curretYearDate = calendar.getTime();
calendar.add(Calendar.DAY_OF_YEAR, -365);
lastYearDate =calendar.getTime();
Object o = new Date();
ViewCriteriaRow vcr = (ViewCriteriaRow)vc.get(0);
for(int i=0;i<vcr.getAttributeNames().length;i++) {
if(vcr.getAttributeNames() == "LastTransactionDate") {
System.out.println("====================== opeartor ================== " + vcr.getOperator("LastTransactionDate"));
if( ("%".equals(vcr.getAttributeValues()[i]) || vcr.getAttributeValues()[i]==null)) {
List nameList = new ArrayList();
nameList.add("LastTransactionDate");
List valueList = new ArrayList();
valueList.add(lastYearDate);
valueList.add(curretYearDate);
vcr.setAttributeValues(nameList, valueList);
vc.addRow(vcr);
JUSearchBindingCustomizer.applyAndExecuteViewCriteria(bc, vc);
Thanks,
Lakshman

Similar Messages

  • How to create a display value and a return value for an item

    Hi! I have an item on a form. I want the default value for my item to be :":APP_USER", but the return value, to be the id of my user. I tried to create a PL/SQL Expression for the default item, but it doesn't work. What do I miss?
    It should be something like this, but it's not.
    begin
    select first_name || ',' ||last_name as "Employee",
    id_employee -- display value,return value
    from employees
    where id_employee = :APP_USER;
    end;
    Does anyone know?
    Thanks!
    Vitaly

    Hi VItaly,
    Display value and return value concept applies very well in case of a Combo box if i am correct, I don't know what type of item is your's.
    But any way, you can have a workaround like,
    Create a hidden item such that it's default value should be ID of the user which can be get from db by using :APP_USER.
    Use the this item for your references.
    I think this will meet your requirement.
    Thanks
    Kumaraswamy.

  • How to get value from list item

    Hi all,
    How to get value from list item?
    I have a problem with the List Item object
    in the Oracle forms.
    How can I retrieve the selected item from
    a list ?
    I didn't find any function like 'list.GET_
    SELECTED_ITEM()'...
    thanks
    Bala

    Hello,
    You get the value as for any other Forms item:
    :value := :block.list_tem ;Francois

  • How to get Value of a item of first record when current record is second

    How to get Value of a item of first record when current record is second in Form6i ?
    get_item_instance_property dose not allow to get value.

    Gerd,
    You're right, there are several other triggers that must be coded, but I was responding to Steve's statement about Inserting or deleting records from the multi-record block. For the record, I use the following to manage a Record Group:
    * When-New-Block-Instance - Initialize the RG
    * block Post-Query - populate the RG
    * When-Create-Record - add new record to RG
    * When-Remove-Record - remove record from RG
    * block When-New-Item-Instance - capture previous value of the item or row
    * When-Validate-Item - Item specific Insert, Update, Delete of values in the RG
    There are a few other places as well, but these are the minimum. It might seem like a lot of code, but then again, I don't use this solution for every multi-line block. Like all tools, you use the right tool for the job. :-)
    Craig...

  • DP Execution-Execute a DP without supplying value for command line argument

    DP Execution - How to execute a DP without supplying value for a command line argument?
    My requirement is like Directive should have an optional command line argument.
    i.e., even if the value is not supplied for the command line arg, my DP should run.
    Your help is appreciable.

    What is DP?
    What is Directive?

  • Fetching unit_of_meaurement value for each item

    Hi ,.
    I want to fetch the value unit_of_measurement (MSEHI) value from table T006
    for each items
    I havent find any linakage
    How can i read these values for each item
    Thanks
    Anil

    I have a material number say, Grumpy. The report that I have shows the total sales for Grumpy for $13,000.00. Grumpy has other submaterials number says Grumpy_1, Grumpy_3, Grumpy_4, Grumpy_5. The report only shows the total quantity sold for each of these submaterials. Say
    Grumpy_1 = 800
    Grumpy_3 = 70
    Grumpy_4 = 1
    Grumpy_5 = 33
    I want to find a way to get an IO that tells me a price sold for 1 quantity, so that I can use it to find the total sold for Grumpy_1, Grumpy_3, Grumpy_4, Grumpy_5 that will add  to equal $13,000.00
    Thanks
    "<i>Sometimes I need what only you can provide: your absence.</i>" ~ Anonymous

  • How to populate values for a new field in target infoprovider

    Hi Experts,
    am new to BI. i would like to know on how to populate values for a new field in the target cube with start rotuine.In my case,  i have a source infoprovider, which has 3 fields and a target infoprovider, which has 5 fields. i need to populate the new 2 fields in start routine. i dont want to populate using Field routine and am using 3.5 version. please assist with code on how to solve this issue.
    Thank you,
    Chitra.
    Edited by: Chitra_BI on Jun 13, 2011 10:23 AM

    Debug the standard code and see where the other fields are getting update. you can use the similar approach and area to code for the new field.
    Regards,
    Lalit Mohan Gupta.

  • How to set value for trim and bleed using jsx script?

    I have tried using bleedoffsetRect but somehow it is not working. Can anybody please help me on how to set value for trim and bleed using jsx script? Any example will be highly appreciated.
    Following is the code I am trying with:
    var _saveName = new File ( root_path +_strFileName+".pdf");
        var _saveOpts = new PDFSaveOptions();
        _saveOpts.printerResolution = 300; 
        var bleedarray = new Array();
         bleedarray[0] =9.00;
         bleedarray[1]=9.00;
         bleedarray[2]=9.00;
         bleedarray[3]=9.00;    
        _saveOpts.bleedOffsetRect = bleedarray;

    I would expect although I've not actually tried this for the bleed off set box to be larger than the artbaord and the first two values to be negative or 0…
    var bleedarray = new Array(-9,-9,artboard.width+9,artboard.height+9);
    Where 'artboard.width' & 'artboard.height' you will have calculated from your file. An Array(9,9,9,9); would not constitute any boxes bounds.

  • How to assign values for more than one field

    Hi,
    I have written following code
    constants: fieldname(30) value '(SAPMF02D)KNA1-AUFSD'.
    constants: fieldname1(30) value '(SAPMF02D)KNA1-LISFD'.
    constants: fieldname2(30) value '(SAPMF02D)KNA1-FAKSD'.
    field-symbols: <L_FIELD>  TYPE ANY.
    field-symbols: <L_FIELD1> TYPE ANY.
    field-symbols: <L_FIELD2> TYPE ANY.
          Assign (fieldname) to <l_field>.
          <L_FIELD> = 'ZB'. " value according to your requirement
          Assign (fieldname1) to <l_field1>.
          <L_FIELD1> = 'ZB'.
    while debugging <l_field1> is not assinging (fieldname1).
    Im able to assing for (fieldname).
    how to assign value for (fieldname1).
    plz suggest me to assign values for more than one field.
    Regards,
    Brahmaji

    Hello,
    Because there is no field name called LISFD in KNA1. Actually you misspelled the field name.
    It is KNA1-LIFSD

  • How is cost allocated for consignment item ?

    Hi Gurus,
    How is cost allocated for consignment item ? Is it based on inforecord price ? Or is it based on the split valuation price ?
    Detailed and answers appretiated. Points will be rewarded suitably.
    Thanks,
    Anil

    Hi All,
    Thanks for your help. I will award points.
    Another question>>>>We want to move consignment material to other location. Now this can be - a plant few miles away or another country.
    Material price in this case will be inforrecord price or price in material master MAP.???
    Thanks,
    Anil

  • Can we see costing value for line item batch in Batch Information Cokcpit r

    Can we see costing value for line item batch in Batch Information Cokcpit report - BMBC?
    Business like to see standard cost/ item and extended cost which should be qty in inventory * standard cost.
    Help appreciated.
    Edited by: Tom_Eric on Jan 13, 2012 2:33 AM

    HI.
    YES it is passible.
    If the GL is activated line item display check box is active then we can able to see the data as per line items.
    T<Code. Fbl5n
    Thanks.
    Vasu
    Edited by: Vasu Enaguthi on Apr 7, 2010 8:46 AM

  • How to bind values for input parameters from an adf table?

    Hi,
    The version I am using is
    Jdev TP4 11.1.1.0.0
    I need to know how to bind values for input parameters to methods.
    I have created an af:table and I have a button created using a method which is outside the af:table. This method needs to take input parameter values from the column values in the table.
    When I have an adf form instead of the table the binding works.
    Any help?
    Thanks.

    Hi Balaji,
    you need to bind you table to a backing bean and call a method in the backing bean when you hit the button. In the method you get the selected row from the table and have access to the columns of it. Then call the the method with the parameters.
    To bind the table to a bean select the properties of the table, go to behavior section and look for the advanced section 'Binding' property.
    Select the small down arrow at the right side and click edit. In the dialog select or create a bean and property for the table.
    Go to the button properties, look for 'Action', again select the small down arrow and click 'Edit'. Select the bean which holds the table property and create a method for the button.
    The method look like    public void bearbeitenQuelle(ActionEvent actionEvent)
            // Add event code here...
            RichTable lTable = getYourTable();
            Object lData = lTable.getSelectedRowData();
            FacesCtrlHierNodeBinding lNB = (FacesCtrlHierNodeBinding) lData;
            YourViewRow lRow = (YourViewRow ) lNB.getCurrentRow();
        }Hope the get you started
    Timo

  • How to set value for radio button in sap crm survey suite

    Hi ,
    I created a survey in CRM Service, in which I added a question with answer as '10 Selection Button Group ('radio button'). And answer has 11 answer options (which means 11 radio buttions). Now when we test the survey, the value for the radio buttons is appearing like 'id_0050569b03091ee480a29d8ee61e953c'. But i want to set a specific value for each radion button (from 1 to 11). So, how to set value for radio button in sap crm survey suite???.
    Thanks & Regards,
    Seshu

    Hi,
    I found solution myself. Click on Goto -> Editing Mode -> Expert Mode. Now you can set value for radio button.
    Regards,
    Seshu

  • How to set value for Dropdown control using Querystring filter wepart

    Hi,
    I have a dropdown in my customized list form and need to set the value for the dropdown control using query string filter web part.
    I am able to set value for textbox control using Query String Filer web part.
    But, since the dropdown values are not populated on form load, the value is not set for dropdown control.
    How to load the values in dropdown control on form load and set a value using Query String filter webpart?
    Thanks,
    dhijit

    Hi,
    According to your post, my understanding is that you want to filter choice field using Query String Filter web part.
    To filter using query string filter web part, we can set the default value for the choice field in the query string filter web part panel as below, then connect to the list.
    Now it would be filter by the value you have set.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to set value for selectOneChoice

    Hello,
    How to set value for selectOneChoice defined as:
    <af:selectOneChoice label="Label" id="soc1" binding="#{DepositorMergingBean.socSurnameComponent}">
    <f:selectItems id="si1" value="#{DepositorMergingBean.socSurnames}"/>
    </af:selectOneChoice>
    where socSurnames is List<SelectItem> - manually filled list of SelectItem(SomeObject, (String)text_description), so - SOC is filled manually (no binded iterators, etc..)
    Neither socSurnameComponent.setValue( new Integer(0) ) nor socSurnameComponent.setValue( socSurnames.get(0) ) do not help.
    Thanks in advance.

    this.selectOneChoice.setValue(selectItems.get(2).getValue());Try as per the following sample:
    SelectOneChoiceTest.JSPX:
    <af:form id="f1">
    <af:selectOneChoice label="Select One Choice" id="soc1"
    binding="#{SelectOneChoiceTestBean.selectOneChoice}">
    <f:selectItems value="#{SelectOneChoiceTestBean.selectItems}"
    id="si1"/>
    </af:selectOneChoice>
    <af:commandButton text="Set Selected Value" id="cb1"
    actionListener="#{SelectOneChoiceTestBean.onClick}"/>
    </af:form>
    SelectOneChoiceTestBean.java:
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
    public class SelectOneChoiceTestBean {
    private RichSelectOneChoice selectOneChoice;
    public SelectOneChoiceTestBean() {
    super();
    private List<SelectItem> selectItems;
    public void setSelectItems(List<SelectItem> selectItems) {
    this.selectItems = selectItems;
    public List<SelectItem> getSelectItems() {
    selectItems = new ArrayList<SelectItem>();
    selectItems.add(new SelectItem("One", "One"));
    selectItems.add(new SelectItem("Two", "Two"));
    selectItems.add(new SelectItem("Three", "Three"));
    return selectItems;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    public void onClick(ActionEvent actionEvent) {
    this.selectOneChoice.setValue(selectItems.get(2).getValue());
    Thanks,
    Navaneeth

Maybe you are looking for