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

Similar Messages

  • 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

  • Dynamically assign value to bind variable in a view object before pageload

    I found that it is extreamely hard to find an example to assign the bind variable in View object at runtime using a data attribute defined in Human task activity. Most of the available samples use a Literal value to do the assignment. In my case, I want to dynamically display the content by assigning the data attribute in Human task to the bind variable in view object before a pageload.
    I do not want to bind the view object to some command component to click a button or link in order to make it work (Unnecessary components in my page).
    The issue is how to access the data attribute in Human task in the java code of client interface in AppModule? or is there a way that I can access the data attribute in Groovy script expression of the bind variable? or if I can access the process data object defined in my BPM process to do the assignment at runtime?
    Really need help on the issue, and I cannot believe that it is so hard to accomplish.
    Thank you very much,

    chk this
    Passing default value to bind variable on page load.
    http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html

  • How to share a bind variable across multiple view objects?

    Hi, Can someone tell me if it's possible to share a bind variable among multiple view objects within an application module? My web page displays data from different VOs on different regions. But all data should be controlled by the same bind variable, which appears in all queries. How can I achieve this?
    Please help.

    Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
    I can think of 2 approaches.
    1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
    2) Create a AM client interface method that programatically sets the bind variable in each VO.
    Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
    CM.

  • Setting bind variable value programmatically for master and child VO's

    Defined following BC:
    Serv VO - Master VO, has Bind_cNum (bind variable)
    ServDetail VO - Child VO, has Bind_cNum2 (bind variable)
    ServViewLink VL - View link between Serv VO & ServDetail VO
    in AMModule Impl have custom WS:
    public List<ViewRowImpl> getMyServices(String cNum)
    List<ViewRowImpl> result = new ArrayList<ViewRowImpl>();
    ViewObjectImpl vo1 = getServ(); //Master VO
    vo1.setNamedWhereClauseParam("Bind_cNum", cNum);
    vo1.setForwardOnly(true);
    ViewObjectImpl vo2 = getServDetail(); //Child VO
    vo2.setNamedWhereClauseParam("Bind_cNum2", cNum);
    vo1.executeQuery();
    while (vo1.hasNext()) {
    result.add((ViewRowImpl)vo1.next());
    return result;
    I am passing same cNum parameter to both Serv VO (Master VO) and ServDetail VO (child VO) as above. (this is in addition to view link bind variable :Id)
    It shows in the logs that it is setting the values correctly:
    <ViewRowSetImpl> <setNamedWhereClauseParam> [382] Serv ViewRowSetImpl.setNamedWhereClauseParam(Bind_cNum, 11771370)
    <ViewRowSetImpl> <setNamedWhereClauseParam> [383] ServDetail ViewRowSetImpl.setNamedWhereClauseParam(Bind_cNum2, 11771370)
    <ViewRowSetImpl> <doSetWhereClauseParam> [383] Serv ViewRowSetImpl.doSetWhereClause(-1, Bind_cNum, 11771370)
    <ViewRowSetImpl> <execute> [385] Serv ViewRowSetImpl.execute caused params to be "un"changed
    <OracleSQLBuilderImpl> <bindParamValue> [394] Binding param "Bind_cNum": 11771370
    <ADFLogger> <addContextData> Execute query
    -- when executing view link
    <ViewRowSetImpl> <setParamValues> [425] ServViewLink_0 ViewRowSetImpl.setParamValues params changed
    <ViewRowSetImpl> <doSetWhereClauseParam> [426] ServViewLink_0 ViewRowSetImpl.doSetWhereClause(-1, Bind_cNum2, null)
    <ViewObjectImpl> <bindParametersForCollection> [436] For RowSet : ServViewLink_0
    <OracleSQLBuilderImpl> <bindParamValue> [437] Binding null of type 12 for "Bind_cNum2"
    <OracleSQLBuilderImpl> <bindParamValue> [438] Binding param "Bind_Id": 5018
    from above log, when ServViewLink_0 is executed, it is changing Bind_cNum2 bind variable to null.
    how can i pass same bind variable value to both Master and Child view objects from AM Impl.java
    Edited by: bsrao on Oct 11, 2012 6:07 PM
    Edited by: bsrao on Oct 11, 2012 6:10 PM
    Edited by: bsrao on Oct 11, 2012 6:12 PM

    Try executing the vo1 query before setting the bind variable for vo2, then execute the vo2 query (if that's what you want to do).

  • Dynamic default bind variable

    Hi!
    I have a bind variable in a view object, where i want the default variable to be a text version of now (timestamp) in the format 'dd-mm-yyyy HH:mm'.
    I have tried to look at a solution using Groovy Expression, but I cannot figure out how to do it.
    Please HELP!!!! :-)
    /Casper

    Hi,
    You can create a method in your viewObject implementation class and retrieve the value from there, using groovy.
    I have used something similar to retrieve a dynamic parameter in an Entity validator.
    Have a look here: http://www.gabrielsideras.com/2010/10/03/groovy-display-dynamic-error-message-in-validator/
    and here: http://formattc.wordpress.com/2010/04/02/custom-java-bind-variable-in-a-where-clause-of-an-adf-view-object/
    Gabriel.

  • No Signature of Method Error when trying to set Bind Variable Groovy Expr

    I am trying to set a Bind variable on my view object to equal the output of a function defined in the the EntityImpl.java that corresponds to that bind variable.
    I set the value of my bind variable to be = adf.object.getMyServiceType()
    Where the name of the view object I am currently in is called GridSwSoftwareServiceView.xml and the Entity object is called GridSwSoftwareService.java and the EntityImpl file is called GridSwSoftwareService.java.
    I am seeing this error:
    No signature of method: oracle.jbo.common.VariableImpl$VariableExprValueSupplier.getMyServiceType() is applicable for argument types: () values: []
    Does anyone know what this error means?
    I was trying to follow an example from this doc: http://www.oracle.com/technology/products/jdev/11/how-tos/groovy/introduction_to_groovy.pdf
    Edited by: user10791986 on May 21, 2010 2:50 PM

    Looks like a bug... :(
    It works fine as a View Object attribute expression but it fails miserably once added as an expression to the bind variable. In this case, here is a work-around:
    Define the method as static in your EntityImpl.java :
    public static String getMyServiceType() {
    return "EBSO R12";
    Then access it by fully qualifying it with the package and class :
    com.yourpackage.EntityImpl.getMyServiceType()
    Edited:
    On a second thought, I am wondering if the expression is valid since the Entity hasn't yet constructed at that point.... That explains why it works when made static.
    Nick
    Edited by: Nick Haralabidis on May 21, 2010 5:16 PM

  • 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

  • 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

  • Dynamically Setting a Variable from a Connection String that has been set by a Config File

    Hi Guys
    I'm setting up a Master / Slave (Parent / Child) dtsx environment but I'm unable to work out how to dynamically set a variable in the Master dtsx from a connection string that has had its value set by a config file. I'm sure it's possible.
    Below is the what I'm hoping to achieve. I've set up everything apart from the highlighted section.
    Any ideas?

    First, what version of SQL Server are you using?
    You could switch the problem around.  You could set the value of a variable from the config file, then it is easy to use that variable as the connection string source for your connection manager.  At the same time you can use a parent variable
    configuration to map that variable to variables in your child package.
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

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

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

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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 properly set bind variables

    Dear All,
    I am currently confused about how to properly set my Bind Variables
    I have this view using HR standard schema
    Select *
    from Employees
    where EMPLOYEE_ID = :EMP_IDI somehow see three options on how to use this bind variable in an application module.
    Option 1:
    ViewObjectImpl view = this.getEmployeesView();
    VariableValueManager vm = view.ensureVariableManager();
    vm.setVariableValue("EMP_ID", value);
    view.executeQuery();Option 2:
    ViewObjectImpl view = this.getEmployeesView();
    view.setNamedWhereClauseParam("EMP_ID", value);
    view.executeQuery();Option 3:
    EmployeeViewImpl empView =this.getEmployeesView();
    RowSetIterator it = empView.createRowSetIterator(null);
    empView.setEmployeeId(value);
    empView.executeQuery();Question is which is which and what should I use?
    JDEV 11G PS3

    I use is this
    DCIteratorBinding iteratorStatus = Util.getIterator("NameIterator");
    operationBinding.execute();
    Util is reserved in a class.
    public static DCIteratorBinding getIterator(String iteratorName){
    return getDCBindings().findIteratorBinding(iteratorName);
    }

Maybe you are looking for

  • Random Slow Requests that CFTrace Can't Find

    Description: I am troubleshooting some slow loading pages and have been getting some interesting and inconsistent results. I'd like some help on how to better troubleshoot the problem, so that I can fix it. I started by looking at database query time

  • How to use images in drop down list ...

    Hi, i am making a form, which have to include drop down menu with images, for example when you push the drop down list the choices must be small images with vegetables, is it possible to make this with livecycle or with some of adobe products

  • Adapter Engine test tool doesnt work

    Hello I try to send a message from runtimeworkbench I chose Component Monitoring -> Integration server -> Adapter Engine And I put the paramets of the message ( message interface,namespace..etc.) then I put user and password and the url is http://ser

  • Output On change

    Hiya Firstly - I want to know if i can activate an output on Change and not on Create. Secondly - I want the output to be created at a specific time of the date and it should have the data updated till then. For example i create an order before 5'ocl

  • Installing crashes Macbook Pro Retina

    Hi, I'm desperatly trying to install PS 6 on my new Macbook Pro Retina.  But the installer always stops at 80% and crashes the computer.  I have to switch it off and on.  Didn't get any error message (well, haven't found any yet ...). Any idea or hin