Setting bind variables in view objects for LOV

ADF 11.1.1.1.0
I have two application modules - amCodeTable (contains the code tables) and amLOV (contains the list of values)
In amLOV I have a VO aListOfValuesVo (not based on an entity) that runs a query Select * from aTable where userNr = :pBindVar
In amCodeTable I have a VO aMainTableVo based on an EO, This VO has a field (aLOVField) which has a LOV defined on it and uses the
aListOfValuesVo.
I've hardcoded the bind parameter to its corresponding value and everything works as expected, list of values from
aListOfValuesVo available on the aLOVField in aMainTableVo.
I now need to set the bind parameter by code.
What I have tried to do is override the execute query of the aListOfValuesVo in the aListOfValuesVoImpl.java
    @Override
    public void executeQuery() {
       setNamedWhereClauseParam("pBindVar","32");
       super.executeQuery();       
    }If I test the amLOV application module the query returns the correct values.
If I test the amCodeTable the list of values on the aLOVField in the view aMainTableVo is empty.
I've added a breakpoint to the executeQuery() method but it would seem that the method is not called.
How are bind parameters for list of values set ?
Paul

Ok I've activated an SQL trace and got the following :
[498] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch_0 ViewRowSetImpl.doSetWhereClause(-1, pUserNr, null)
[499] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch_0 ViewRowSetImpl.execute caused params to be "un"changed
[500] Column count: 4
[501] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch_0 ViewRowSetImpl.doSetWhereClause(-1, pUserNr, null)
[502] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch ViewRowSetImpl.setNamedWhereClauseParam(pUserNr, 41)
[503] ViewObject: _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch Created new QUERY statement
[504] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch>#q computed SQLStmtBufLen: 238, actual=198, storing=228
[505] Select b.Branch_Nr,Decode(b.status,1,'','*')||b.Branch_Id DisplayId,b.Designation,b.Status
from stt_branch b, stt_users_branch u
where u.user_nr = :pUserNr
and b.Branch_Nr = u.Branch_nr
order by 4,1
[506] Bind params for ViewObject: _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch
[507] For RowSet : _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch_0
[508] Binding null of type 12 for "pUserNr"To me this looks as if 2 lovUserBranch instances have been created a lovUserBranch and a lovUserBranch_0
The parameter is being binded to the lovUserBranch but the LOV is using the lovUserBranch_0 which has a bind value of null
Anybody got any idea as to what is happening ?
Regards
Paul

Similar Messages

  • How to populate bind variable in view objects where clause in ADF faces

    I've got a page with 2 input items.
    The user manually enters the first value.
    On the second input item I have created a LOV for the item which opens in a popup. How do I restrict the data returned in the LOV using the value entered in the first input item. I have created a bind variable and have included it in the where clause for the view object but how do I populated it.

    Here is an example:
    Using the HR schema with the EMPLOYEES and DEPARTMENTS tables.
    Example is using ADF BC and created an EMPLOYEES entity with an updateable view object for page,
    and created a DEPARTMENTS view as a lookup
    (SQL: select department_id, department_name from departments where department_name = :DeptName)
    1: add method to the backing bean to filter the LOV
    public void getTextValueToFilterLOV(ValueChangeEvent valueChangeEvent) {
    Object value_from_form = valueChangeEvent.getNewValue();
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application fapp = fctx.getApplication();
    JUFormBinding formBinding = (JUFormBinding)fapp.createValueBinding("#{bindings}").getValue(fctx);
    DCIteratorBinding dcBinding = (DCIteratorBinding)formBinding.get("DeptLOVIterator");
    ViewObject vo = dcBinding.getViewObject();
    vo.setNamedWhereClauseParam("DeptName",value_from_form);
    vo.executeQuery();
    2. add valueChangeListener to the inputText on the page with an id and autoSubmit="true"
    <af:inputText value="#{bindings.LastName.inputValue}" label="#{bindings.LastName.label}" binding="#{backing_DeptForm.inputText3}"
    id="inputText3"
    autoSubmit="true"
    valueChangeListener="#{backing_DeptForm.getTextValueToFilterLOV}">
    </af:inputText>
    3. reference the LOV with the id name on the partialTriggers property
    <af:selectOneChoice value="#{bindings.EmployeesUpdView1DepartmentId.inputValue}"
    label="#{bindings.EmployeesUpdView1DepartmentId.label}" binding="#{backing_DeptForm.selectOneChoice1}"
    id="selectOneChoice1"
    partialTriggers="inputText3">
    <f:selectItems value="#{bindings.EmployeesUpdView1DepartmentId.items}"
    binding="#{backing_DeptForm.selectItems1}"
    id="selectItems1"/>
    </af:selectOneChoice>
    Summary:
    When you entered a text (LastName), that value is passed into the backing bean method.
    The Bean method code will find the LOV Iterator and put the value into the bind variable.
    Cheers,
    Jim

  • URGEN: How to programmatically assign bind variables in View Object

    Hi,
    I have a method action in my pagedef
    <methodAction id="SetBindAttributeValueToQuotationsView"
                      InstanceName="QuotationsEBAppModuleDataControl.dataProvider"
                      DataControl="QuotationsEBAppModuleDataControl"
                      MethodName="SetBindAttributeValueToQuotationsView"
                      RequiresUpdateModel="true"
                      Action="999" IsViewObjectMethod="false">
          <NamedData NDName="quotTransNo"
                     NDValue="${bindings.SetBindAttributeValueToQuotationsView_quotTransNo}"
                     NDType="java.lang.Integer" NDOption="2"/>
        </methodAction>Im going to assign values to the bind variables and use the method action in my pagedef.
    Thanks.

    hi
    u check ur view name & page def binds value,
    both of them should be same
    thanks

  • Error when Setting value to Bind variable in View Link used in HGrid

    Hi
    I have requirement to pass profile id as bind variable, I have created a VO based on below Query.
    select 'N' Is_Selected, 'N' Is_Already_Selected, 'N' Is_Selected_Copy, a.*
    from XXPA_STATE_CONST_DTLS_V a, xxpa_state_const_dtls b
    where a.child_id = b.child_id(+)
    and b.profile_id(+) = :1
    View Link Query that is being generated is
    SELECT * FROM (select 'N' Is_Selected, 'N' Is_Already_Selected, 'N' Is_Selected_Copy, a.*
    from XXPA_STATE_CONST_DTLS_V a, xxpa_state_const_dtls b
    where a.child_id = b.child_id(+)
    and b.profile_id(+) = :1) QRSLT WHERE PARENT_ID = :Bind_ChildId
    it Shows Errors as
    ## Detail 0 ##
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    could anyone tell what could be the wrong. Do we need to set bind variable in view link Explicitly? or any other alternative.
    Its very Urgent.
    Regards
    Vimal

    Hi,
    I have faced similar problem some time ago. I could not find any solution except removing bind parameters in where clause. I tried to change binding style but it also didn't work. I think the problem is caused by view link's where clause.

  • How to set bind variable for a VO ,

    Hi,
    i got a requirement in which i have to set bind variable for VO , But the Bind variable is coming from payload attribute,
    For example my query in VO is select * from Employee where emp_id="payload attribute"
    How to set this attribute value is from the payload
    Thanks Regard
    Rajendar

    Hi i am getting this exception " Cannot create an object of type:java.lang.Number from type:oracle.bpel.services.datacontrol.data.DataObject with value:21159"
    Actually i am getting Decimal Value from Payload of BPEl process and i am trying to set this to The bind variable
    is that a type cast exception where can i typeCast Those values You should this in a new thread.Dont ask questions out of the scope of this thread.
    Please mark this thread as answered or helpful if you got solution for this thread.
    Thanks!!!

  • Setting bind variables in dependant LoV's : How?

    Hi
    I'm trying to create an LoV dependant upon the value selected in a previous Lov.
    I have created an LoV with a bind variable which executes correctly when run independantly of a form
    When I attach the loV to a form I get prompted to :-
    "Set the binding(s) for the bind variable(s) defined in the lov"
    How do I do this ?
    All replies gratefully recieved, thanks in advance
    Andy

    Examples of using a bind variable LOV are located in the "Building Portals" manual. On technet, click the Documentation tab, then open the "Building Portals" PDF.
    null

  • How to set bind variables for child VO in hierarchy component?

    Hi,
    Recently I created a application with Hierarchy Component with Parent VO (Query based VO with Bind variables in it) and its Child VO along with Child-Child VO(Query based VO with bind variable in it)
    I am able to set bind variable of parent VO but unable to set bind variable for Child-Child VO. Can any one help me regarding this issue?

    Hi i am getting this exception " Cannot create an object of type:java.lang.Number from type:oracle.bpel.services.datacontrol.data.DataObject with value:21159"
    Actually i am getting Decimal Value from Payload of BPEl process and i am trying to set this to The bind variable
    is that a type cast exception where can i typeCast Those values You should this in a new thread.Dont ask questions out of the scope of this thread.
    Please mark this thread as answered or helpful if you got solution for this thread.
    Thanks!!!

  • Best Practice for setting bind variable when application loads

    I am using JDeveloper 11.1.2.3.
    When my application loads, the first unbounded page has a table populated by a named query.
    I would like to set the parameter used by the named query when the page loads, to populate the initial data that is displayed.
    What is the best practice for a solution to this issue?

    user6003393 wrote:
    I am using JDeveloper 11.1.2.3.
    When my application loads, the first unbounded page has a table populated by a named query.
    I would like to set the parameter used by the named query when the page loads, to populate the initial data that is displayed.
    What is the best practice for a solution to this issue?Hi,
    You can set the bind variable on VO by overriding prepareSession() method in Application Module check this http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcservices.htm#sthref357
    Setting bind variable on runtime http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcquerying.htm#CHDECJHD
    Zeeshan

  • Is it possible to set bind variable for picklist?? for messageChoice

    we are trying to develop one new page in local JDeveloper.
    we have requirement for passing a bind variable to a picklist. is it possible?
    Item Type : messageChoice
    Query:
    SELECT DISTINCT TO_CHAR (effective_date, 'YYYY') TYPE
    FROM pay_assignment_actions a, pay_payroll_actions b
    WHERE a.payroll_action_id = b.payroll_action_id
    AND assignment_id =
    (SELECT assignment_id
    FROM per_assignments_x
    WHERE person_id = :person_id AND primary_flag = 'Y'
    AND assignment_type = 'E')
    AND a.action_status = 'C'
    AND b.payroll_action_id IN (SELECT payroll_action_id
    FROM pay_payroll_actions_v
    WHERE action_type IN ('P'))
    AND b.payroll_action_id IN (SELECT payroll_action_id
    FROM xxilo_pre_payments)
    ORDER BY 1 DESC
    processRequest() code:
    PayslipAMImpl am=(PayslipAMImpl)pageContext.getApplicationModule(webBean);
    YearPicklistVOImpl yvo=(YearPicklistVOImpl)am.getYearPicklistVO1();
    Number t = new Number(pageContext.getEmployeeId());
    yvo.setWhereClauseParams(null);
    yvo.setWhereClauseParam(0,t);
    for this query & code we are getting
    ERROR:
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    if we hardcoded person_id in query to some value then we are getting results without any error.

    user603084 ,
    In the query you have specifies bind variable as :person_id , but in your VO execution code you are setting value for bind variable :1
    yvo.setWhereClauseParam(0,t);
    You need to change the bind variable in query , like :1
    and then execute the query of VO, as you have done. Also do executeQuery, after setting bind variables.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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.

  • Bind variables in views

    I am having some performance issues using bind variables in views (Oracle 7.3.4). When I execute the view using '' values the view executes the expected execution plan. When I execute the view using bind variables the execution plan changes to something undesireable. I believe this to be a static execution plan in the case of using bind variables. I have updated all tables referenced by the view and compiled the view; but, the execution plan when using the bind variables does not change. Can you give me some advice on finding out why the execution plan in the case of using bind variables does not change based on the new set of statistics and being re-compiled.

    even if you use a literal isn't that automatically
    changed into a bind variable during at compile time?That would be the case when your have CURSOR_SHARING = FORCE. The default should be EXACT.
    SQL> show parameter cursor_sharing
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACT
    SQL>Actually, since you have the constants in the view, and if everyone uses the view, they share the same shared cursor (since the constants are never changing across each use).
    If you supplement the view with additional WHERE conditions (when using the view):
    SELECT <columns> FROM your_view WHERE <additional_conditions> ;
    Ten you might want to look into using bind variables for values used in such additional conditions.

  • Apex listener installed no test and set bind variables buttons

    I have installed Apex listener and while creating restful service module i dont see test and set bind variables buttons in the source region.
    I went through the many posts. Installed apex listener successfully.
    getting http://localhost:8080/ords/ started message when i start the listener.
    and using Apex URL as http://localhost:7780/pls/htmldb.
    What are the possibilities for this issues?
    Please help me on this.
    Thanks
    Chandran

    Apex listener version is 2.0.9
    Apex version is 4.2

  • Bind a new view object to same adf table at run time

    Hello,
    I have an adf table, that changes based on the type of data the user selects. For example, lets say we have a page that consists of type drop down box at the top and an ADF table at the bottom, which lists data based on the type that is selected from the drop down box. For example, lets say, I have the types (Cars, Planes, and Trains).
    Let's further say we have a view object for cars, one for Planes and one for Trains. Each VO has its own specific set of attributes associated with them, which in should be reflected in the adf table that's on the screen.
    So for example, I select Train..
    My table should contain the columns, num cabs, train type, year built
    For plane, the columns might be Num engines, plane manufacturer, size(ie. 747, 727, etc), year built
    Some type of thing with Cars , cylinders, color, model, year, etc.
    Is there a way to tell my adf table to use a specific view object(ie. Plane, train, or car) at runtime?

    You can try implementing this with dynamic components, e.g. dynamic table
    >
    ADF Dynamic and ADF Read-Only Dynamic Table: Allows you to create a
    table when the attributes returned and displayed are determined dynamically
    at runtime. This component is helpful when the attributes for the
    corresponding object are not known until runtime, or you do not wish to
    hardcode the column names in the JSF page. For more information about
    working with dynamic components, see Section 26.7, "Using a Dynamic Form
    to Determine Data to Display at Runtime."
    >
    Or you use dynamic regions and swithc the region containing the table depending on the selectOneChice. Check http://docs.oracle.com/cd/E24382_01/web.1112/e16182/taskflows_regions.htm and https://blogs.oracle.com/shay/entry/adf_dynamic_regions_switching_just
    Timo

  • Setting bind variable for a view object from the Managed Bean

    Hi,
    i am using JDeveloper 11g, i have to create LOV in the JSF. To show the LOV, it has to populate data using View object and its query parameter need to be sent from the Managed Bean.
    For the View object i want to set the bind variable parameter from the managed bean value. bename is stored in a managed bean (session scope)
    #{beantest.bename}
    But it gives the following exception.
    JBO-29000: Unexpected exception caught:
    org.codehaus.groovy.control.MultipleCompilationErrorsException,msg=startup failed, Script1.groovy: 1: expecting '!',found '{'@ line1, column 2.
    I have followed the link http://kr.forums.oracle.com/forums/thread.jspa?threadID=615474 like Frank wrote on 8.2.2008:
    But steps are not clear.
    How to input the VO bind parameter with Managed bean variable?
    Any Help
    Regards
    Raj
    Edited by: user9928180 on Dec 17, 2008 9:51 AM

    Hi,
    a bind variable in a VO needs to be exposed as an executeWithParams operation in the pageDef file. Just add a new action binding to the pageDef file (context menu) and select the executeWithParams operation on teh VO. Then in the argument field, reference the managed bean property for the value
    Frank

  • About dynamically setting bind variable in LOV View

    Hi,
    I have a LOV VO for an af:SelectOneChoice field in the page.
    The LOV is depended on an SQL statement in which there is a bind variable in the where clause.
    When I open the page, I set the bind variable by using VO.setNamedWhereClauseParam in the prepareSession method in the application module, followed by VO.executeQuery();
    The problem is, the af:SelectOneChoice is blank. Why?
    If I do not use the bind variable in the SQL, I can see rows in the af:SelectOneChoice field.
    When is the proper time to populate the LOV? And where should I put the code for populating the LOV?
    I am sure that the VO is populated, because after I executeQuery, there are many rows in the VO.
    Thanks
    Stephen
    null

    Hi Franky,
    Yes, when I set a default value for the bind variable, everything is OK.
    But I want the bind variable dynamically be set when the AM is initiated. Is there a way to do that?
    Stephen

Maybe you are looking for

  • Problem with transfer and ordering of tracks on new Zen Nano P

    I recieved my Gb Zen Nano Plus player on wednesday and transferred quite a few tracks to the player that night. They transferred fine, I was able to customize the playing order and all the songs play fine. But since then, I have been unable to transf

  • BCS - Virtual cube with services

    I have basicube CUBE1 assigned to virtual cube VCUBE1 in BCS. There is an entry in table RSSEM_UCR0_IPD reflecting this assignment. I want to assign a 2nd virtual cube VCUBE2 (exact copy of VCUBE1) to CUBE1 so that I can test an updated function modu

  • Can't update my ipod touch 4th generation and I have to restore it since it no longer works

    Hi, I just updated my 4th genreation ipod touch and it showed me an error message. It no longer works and I have to restore it now.. Why can't I update the ipod??

  • My ipod touch 3rd gen is showing dec 31 1969

    my ipd touch 3rd gen is showing dec 31 1969 and incorrect time I haven't used it in awhile and was dead, recharged it, resynced it several times, didn't work. I tried to change the time manually and couldnt. the calendar isn't on BE. Help!!

  • Error compiling Oracle's adftoystore

    I'm getting problems compiling adftoystore with JDeveloper 10.1.3. I have not changed anything in the default install. Maybe my packages oracle.jbo and oracle.jdeveloper doesn't have some classes. Here are some of the compiler errors: Error(4,19): ca