How to build a full dynamic WHERE expression in ADFBC Faces View Object ?

Dear Steve
>
I need an example about how to build a full dynamic WHERE expression in
ADFBC View Object
In UIX I known to do that, but i don't kwown how to do in ADFBC Faces.
please help me to see an example.
thanks
Juan Carlos

You write an AM level method to set the where clause and you expose it as a client method. (just like you did before)
Then you can drag this method onto a page as a button and then pressing on this button will execute the method.
If you want this to be done automatically without pressing a button - you go to the pagedef.xml file for your page and add a methodInvocation binding to that AM method, and then add a method executable to the executables section calling this method.

Similar Messages

  • Dynamically change the Binding of a view object

    I want to reuse a panel several times in my application. The VO has one bind parameter (:1). The same panel should be reused several times with different bind variables.
    I found a technical note concerning this issue called: How to Dynamically Change the binding of a View Object to a JClient Panel. This works for JDeveloper 9i but not for JDeveloper 19g. Does anybody know how to dynamically change the binding in JDeveloper 10g

    You may use bindRowSetIterator() and pass in a custom fetched ViewObject or a RowSetIterator to the iterator binding that is displayed in your panel.

  • How to build a query dynamically....

    hi...i want to build a query dynamically. i don't want to build query by using string buffer. i want to create it directly by using sql query itself.
    my situation is like this....i have four drop down list in a page. The user can search the things based on one or two or three or four selected values.
    how to build a query for this kind of situation....pls let me know.
    Edited by: success_shiva6mca on Mar 3, 2008 12:39 PM

    there are two problems with building sql directly.
    1. it allows sql injection
    2.it allows XSS
    google them and you will understand if you dont already.
    I will recoment catching the values and using preparedStatements

  • How to bind dynamic columns in ADF table to view object

    In the below piece of code i am trying to bind a dynamically added column to my newly added attribute in view object, but the value expression does not set the value of this attibute in the view object please help on what is wrong in this code ??
    <af:table value="#{bindings.ViewObj1.collectionModel}" var="row"
    rows="#{bindings.ViewObj1.rangeSize}"
    emptyText="#{bindings.ViewObj1.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.ViewObj1.rangeSize}"
    filterModel="#{bindings.ViewObj1Query.queryDescriptor}"
    queryListener="#{bindings.ViewObj1Query.processQuery}" varStatus="vs"
    selectedRowKeys="#{bindings.ViewObj1.collectionModel.selectedRow}"
    rowSelection="single"
    binding="#{backingBeanScope.backing_createDTpg1.table1}"
    id="table1"
    columnSelection="single"
    partialTriggers="::addCol ::addColAfter ::addColBefore ::removeCol ::addRow ::addRowAfter ::addRowBefore ::removeRow ::addAction ::addActionAfter ::addActionBefore ::deleteAction :::dialog1 :::d1"
    allDetailsEnabled="true" verticalGridVisible="false"
    horizontalGridVisible="true" width="100%" disableColumnReordering="true"
    selectionListener="#{bindings.ViewObj1.collectionModel.makeCurrent}"
    immediate="true" contentDelivery="immediate"
    editingMode="clickToEdit" autoHeightRows="-1">
    <af:column sortProperty="Sno" filterable="false" sortable="false"
    headerText="Sno"
    align="center" width="28" rowHeader="true"
    inlineStyle="font-style:italic;" frozen="true"
    id="sno" selected="true" headerNoWrap="true"
    displayIndex="0">
    <af:outputText id="ot0" value="#{vs.index+1}"/>
    </af:column>
    <af:column id="separatorColumn" align="center"
    width="15" frozen="true" displayIndex="1"
    rowHeader="unstyled" sortable="false"
    filterable="false" selected="false"
    inlineStyle='background-image:url("jheadstart/images/jsp_forward.png"); background-repeat:no-repeat; outline-color:InactiveCaption; outline-style:solid; outline-width:thin;'
    headerText=""/>
    </af:table>
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind =
    (DCIteratorBinding)dcBindings.get("ViewObj1Iterator");
    ViewObject decisionTableView1 = iterBind.getViewObject();
    System.out.println("before getAttributeCount :"+decisionTableView1.getAttributeCount());
    int counter = decisionTableView1.getAttributeCount() + 1;
    AttributeDef attribute =
    decisionTableView1.addDynamicAttribute("condition_" + counter);
    RichColumn column = new RichColumn();
    column.setId("condition_" + counter);
    column.setHeaderText("condition_" + counter);
    column.setNoWrap(true);
    RichInputText inputtext = new RichInputText();
    inputtext.setId("condition_"+counter);
    inputtext.setAutoSubmit(true);
    inputtext.setValueExpression("condition_"+counter,
    getValueBinding("#{row.bindings.condition_" +
    counter +
    ".inputValue}"));
    column.getChildren().add(inputtext);
    RichCommandImageLink headerLink = new RichCommandImageLink();
    headerLink.setText("<<Select Fact>>");
    headerLink.setId("conditionLink_" + counter);
    column.setHeader(headerLink);
    List columnList = this.table1.getChildren();
    int separatorColumnIndex =
    findColumnIndex(columnList, "separatorColumn");
    if (columnIndex == -1 || columnIndex > separatorColumnIndex) {
    columnIndex = separatorColumnIndex;
    System.out.println("Column Index :" + columnIndex);
    column.setDisplayIndex(columnIndex);
    this.table1.getChildren().add(columnIndex, column);

    Sorry Frank i could not figure out what u rtrying to say.
    In my case i have ADF table with two predefined coulmns :
    1 : a serial number read only column
    2 : a separator coumn
    I need help to bind the newly created dynamic attribute in the VO with my newly created column in the ADF table which has a input text as child.
    My problem is binding the is not working properly as values entered in the Table are not reflected in the VO.
    And when i insert a new column in between two columns which has already filled values the data in the rows does not shift coreespondingly..
    Edited by: user10281080 on Jul 27, 2009 12:22 AM

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • How to set transient value to persistent attribute at commit in View Object

    Hi
    I'm using JDev11.1.1.2
    I have a transient atttribute X in my View Object and a persistent attribute Y. I want the value of X to be assigned to Y before commit.
    I saw that the entity has a method doDML that is used for this, but the problem is that this transient attribute is in my View Object, not entity object.
    Any ideas?
    Thanks

    Hi
    My transient attribute has a groovy expression assigned. This expression is calculated from other attributes in the view object.
    It seems that the setter method of the transient attribute is not called when the value gets updated through groovy.
    I used a transient attribute that duplicates my persistent attribute because groovy expression on transient attributes are recalculated, and the groovy expression on persistent attributes are not recalculated - they are used only for default values.
    Any other ideas are appreciated!
    Thanks

  • How to Build Attribute Dimension Dynamically & Load with LCM?

    Hi, I'm trying to modify the existing outline at cilent's site. For some reason, when I pulled the outline with extractor, it didnt come out in the format that is compatible with Outline Load Utility. I was told to use LCM so I may still load with minimal to no modification to the existing structure of outline.
    So can I build dimensions dynamically in EXCEL then load with LCM and push to Planning?

    The log came back with many unrecognized headers in the outline. I spoke to Oracle Support many times, and they said that the format of our outline is improper for Outline Load Utility to read.
    Since the outline has already been incorporated, we are not allowed to many any significant changes. That is why we were advised to use LCM.
    I tried to use a sample of one of the existing attribute dimensions in XML as the base and build the new attribute but it failed. I would appreciate if you can provide steps by steps resources to show how to add new attributes to the existing outline.

  • How to execute procedure with dynamic where condition.

    Hi All,
    I am facing a probelem
    Issue :
    I am having a parameter p_id in my procedure based on the value of this parameter i want to change the where condition.
    How to do so?
    Code:---------
    create or replace procedure p_1
    ( p_id in emp_dummy.empno%type)
    is
    parameter_1 varchar2(2000);
    v_sal number;
    begin
    if p_id = 1 then
    parameter_1 := 'where empno = 1';
    else
    parameter_1 := 'where 1=1';
    end if;
    select salary into v_sal from emp_dummy||' '||parameter_1;
    end;

    Dynamic SQL is not the best of ideas, but if you must...
    EXECUTE IMMEDIATE 'select salary from emp_dummy where empno=nvl(:x,empno)' into v_sal using p_id;Then if you pass in the p_id to the procedure it will select the salary for that employee and if null is passed in then it will select the salary for all employees. Now here's a problem because you are trying to return a single value and if you don't specify the employee then it will try and return multiple values from that select, so you probably want to do something like give the sum of the salaries...
    EXECUTE IMMEDIATE 'select sum(salary) from emp_dummy where empno=nvl(:x,empno)' into v_sal using p_id;

  • SSIS : How to create Column Header dynamically using expression in Flat File Source

    Hi Team,
    I need to keep configured Header Names for columns, Is there is any way to set each column name from expression? or is there is any other way?

    Nope
    But you could add a dummy row to your source to include column headers and then use options column headers in first row in flat file connection manager.
    So suppose you've three columns column0,coulmn1,column2 and you want to make it as ID,Name,Datethen make source query as
    SELECT 'ID' AS Col1,'Name' AS Col2,'Date' AS Col3, 0 AS ord
    UNION ALL
    SELECT Column1,Column2,Column3,1
    FROM YourTable
    ORDER BY Ord
    then choose  column headers in first row option
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to? Populate sequence in 2 Entities comprising 1-1 View Object

    Hello all,
    In my DB model, I have modeled sub types of an entity by having a main table with the common fields and then separate tables (with 1-1 relationship) to the main table with the fields that are specific to each type. Each of these tables has an ID column as the PK. I have created a trigger on the main table to auto-populate the ID from a sequence. If I have a VO based upon 2 of the entities (in a 1-1 relationship), how can I get the sequence # from the main table in order to populate the specialized table?
    Regards,
    john

    The TreeViewAdaptor is responsible for mapping your custom data to the tree view itself.  I almost always start by making it return some fixed number of objects with names "item 1" etc. That way you get the tree view working first.
    Then, after you get it laid out and displaying properly, you can worry about using real data.  At that point, you have your adaptor return the actual number of items in your list and each individual item.  Then you can populate your list when you push your button and then invalidate the IControlView of the tree view widget to cause it to redraw.  At that point your adaptor will get called and your data should appear.
    Jon
    "Expert for hire"

  • How to create LOV not based on a View Object attribute?

    Hi,
    I am creating a handed-made search form and I want to create an af:inputListOfValues.
    I have :
    - a read-only-view-object to get the LOV values from BD.
    - af:inputListOfValues tag (droped from Component Palette).
    How can I create the listOfValuesModel in Bindings layer? (the inputListOfValues is not based on a View Object attribute).

    Sorry, I think I am not very clear in my posts.
    My requirement is to create a LOV but I have no ViewObject. I just want an input (not based on a view object attribute), alone, but with a LOV (where lov's datas are get from a view object).
    In a "normal" LOV I would have something like this :
    in jsff :
    <af:inputListOfValues id="departmentIdId"
                                popupTitle="Search and Select: #{bindings.DepartmentId.hints.label}"
                                value="#{bindings.DepartmentId.inputValue}"
                                label="#{bindings.DepartmentId.hints.label}"
                                model="#{bindings.DepartmentId.listOfValuesModel}"
                                required="#{bindings.DepartmentId.hints.mandatory}"
                                columns="#{bindings.DepartmentId.hints.displayWidth}"
                                shortDesc="#{bindings.DepartmentId.hints.tooltip}">
            <f:validator binding="#{bindings.DepartmentId.validator}"/>
            <af:convertNumber groupingUsed="false"
                              pattern="#{bindings.DepartmentId.format}"/>
          </af:inputListOfValues>in pageDef :
    <listOfValues StaticList="false" IterBinding="EmployeesView1Iterator"
                      Uses="LOV_DepartmentId" id="DepartmentId"/>in model layer : a view object (EmployeeView) with view accessor and LOV based attribute, and a read only view object (DepartmentRVO) to get datas for the LOV.
    But in my case I have no ViewObject, so I don't know how to create the listOfValuesModel in fragment pageDef.
    I have :
    <af:inputListOfValues label="Label 1"
                                    popupTitle="Search and Result Dialog"
                                    id="ilov1" model="here I want to point to a listOfValuesModel but I don't know how to create it"/>in pageDef : the listOfValuesModel but I don't know how to create it.
    in model layer : just a read only view object (like DepartmentRVO), to get the datas for the LOV.
    Edited by: h0s on 29 févr. 2012 00:31

  • How to bind a user selected value to a view object bind variable?

    Hi
    I have two pages in ADF BC application. In the first page ,i will give a drop down menu to user which displays all the table names in my databse.
    when the user selects a table and goes to the second page..he should be given a menu or a check list of all the columns in the user selected table....
    to display the columns i have used the query
    Select COLUMN_NAME from user_tab_columns where table_name = : table_name in the view object.
    now how to bind the user selected table value in the first page to the table_name bind variable in view object ?
    thanks
    swathi.

    Hi,
    depends on how the select box is implemented. With ADF and ADF Faces, the default value selection is the list index. In a value change listener you could look up the selected value from the underlying iterator. Store this value e.g. in a session attribute and point the NDValue of the ExecuteWithParams operation to #{sessionScope.your_attribute}
    Frank

  • Use view object as table in attribute expression of view object

    Hi. I have a view object for which I need to add some transient attributes associated to a SQL expression which works good. But when I need to define an attribute expression associated to a view object expression, not table, the framework doesn't recognize it. It is, when I want to use an expression like this:
    select attribute from MyViewObject where id=EntityObject.id
    I know I can call EntityObject.id but not use the view object MyViewObject as a table. Is it possible? Is there a way to do something like this? Greetings.

    Hi Timo. The use case consist of having a VO with static values and there is another VO that references as foregin key the previous VO, something like:
    VO1: Statuses of Vendor
    VO2: Vendor detail with attributes including the status
    In af:table component I want to show vendor info showing the status name and not the id of the status. I thought there was something like hibernate in which I could query the VO as a table. Greetings.

  • How to set query for child View Object?

    I have a hGrid in standard page. Two View Objects are present connected using view link. I need to set where clause in the child View Object. The changes are not getting reflected when i set the where clause. Also when i try to fetch rowCount it returns 0 for child View Object. But i am able to get the value for parent View Object. Any suggestions please.

    Hi,
    This solution worked for me last time, Please create One blank row and delete that row(For Child VO).
    Why we are doing this? : Because the child vo pointer might not init. See this is not our fault, this is because of OA Framework. But this works for me :)
    Thanks,
    Shrikant

  • How to build dynamic select query

    Using the ZCO_SETTLE_CHK-REC_FIELD and DISTRIBUTION_RULE-KONTY write a dynamic select single query <table>-<field name> e.g. <COAS>- <AUART> on the <table> e.g. <COAS>. If the DISTRIBUTION_RULE-KONTY is u2018ORu2019, then use DISTRIBUTION_RULE-AUFNR value in the where clause of the query to fetch the ZCO_SETTLE_CHK-REC_FIELD value maintained in the <table>-<field name>. If DISTRIBUTION_RULE-KONTY = u2018KSu2019 or u2018PRu2019 use DISTRIBUTION_RULE-KOSTL or DISTRIBUTION_RULE- PS_PSP_PNR respectively in the where clause to fetch the values.
    For above how we can build dynamic query

    Hi,
    Refer the below code which helps to design a dynamic where condition.
    IF NOT p1 IS INITIAL.
    CLEAR : lv_p1_condition.
    CONCATENATE 'F1' ' = ' '''' p1 '''' INTO
    lv_p1_condition.
    ENDIF.
    IF NOT p2 IS INITIAL.
    CLEAR : lv_p2_condition.
    CONCATENATE 'F2' ' = ' '''' p2 '''' INTO
    lv_p2_condition.
    ENDIF.
    IF NOT p3 IS INITIAL.
    CLEAR : lv_p3_condition.
    CONCATENATE 'F3' ' = ' '''' p3 '''' INTO
    lv_p3_condition.
    ENDIF.
    IF NOT lv_p1_condition IS INITIAL.
    CONCATENATE lv_p1_condition lv_condition
    INTO lv_condition SEPARATED BY space.
    ENDIF.
    IF NOT lv_p2_condition IS INITIAL.
    IF lv_condition IS INITIAL.
    CONCATENATE lv_p2_condition lv_condition
    INTO lv_condition SEPARATED BY space.
    ELSE.
    CONCATENATE lv_condition 'AND' lv_p2_condition
    INTO lv_condition SEPARATED BY space.
    ENDIF.
    ENDIF.
    IF NOT lv_p3_condition IS INITIAL.
    IF lv_condition IS INITIAL.
    CONCATENATE lv_p3_condition lv_condition
    INTO lv_condition SEPARATED BY space.
    ELSE.
    CONCATENATE lv_condition 'AND' lv_p3_condition
    INTO lv_condition SEPARATED BY space.
    ENDIF.
    ENDIF.
    SELECT * FROM link INTO wa
    WHERE lv_condition .

Maybe you are looking for