Second LOV based on First LOV in Oracle APEX tabular Form

Hi,
I had created a tabular form in which I am having two LOV's. This form is based on a query.
I had created a javascript function which internally calls AJAX and populates the second LOV based on the value selected in first LOV when onchange.
But the issue is, when the user recalls this APEX page to view the details or edit the details, the second LOV shows all the values instead of showing only the values related to first LOV.
In the second LOV query I am trying to write the below query.
select function_name fn
,function_code_id fci
from catering_function_codes
where function_type_id = NVL(#FUNCTION_TYPE_ID#,function_type_id)
order by to_number(function_code_id)
in which #FUNCTION_TYPE_ID# is the value of first LOV. But I am getting the below error.
report error:
ORA-20001: Error fetching column value: ORA-06550: line 1, column 187:
PL/SQL: ORA-00911: invalid character
ORA-06550: line 1, column 7:
PL/SQL: SQL Statement ignored
How can you refer to the Second LOV the value of First LOV in a report based tabular form?
Kindly let me know if you do not understand the issue.
Please help me in this issue.
Thank you
Regards
Dev

Hi Roel,
Thank you for the quick reply.
I used the query as given by you. This time it is not giving any error but showing all the values in the second LOV irrespective of what ever value is present in the first LOV
This is an apex tabular form which is generated by apex based on a query. The controls will be dynamically generated by APEX for each row. How can we hard code the control name to :P99_FUNCTION_TYPE_ID?
Please help me in this issue. Thank you
Regards
Dev

Similar Messages

  • Loading second dropdown based on first dropdown Jdev 11.5

    Hi All,
    I have a requirement of loading the second dropdown on selecting first dropdown.
    Ex:- conside i have state dropdown, when i select and state it should load city(dropdown) of the states.
    I tried using valuchange listerner with partial trigger it didnt work. Any help would be of great help.
    Please let me know.
    Thanks,
    Nitin
    Edited by: 811407 on 21-Dec-2011 02:59
    Edited by: 811407 on 21-Dec-2011 02:59

    http://www.youtube.com/watch?v=nXwL2_RP7AQ.
    you eg: goes here.
    http://www.youtube.com/watch?v=94PrwXWDEjI
    http://andrejusb.blogspot.com/2008/12/cascading-lovs-in-oracle-adf-11g-update.html

  • ADF BC selectOneChoice- populating an LOV based on another LOV

    scenario:
    country:country_id, country_nme ViewObj: CityVO
    city: city_id, country_id, country_nme ViewObj:CountryVO
    cc: cc_id, country_id(FK), city_id(FK) ViewObj:CCVO
    i have got two combo boxes(selectOneChoice) displaying
    coutntry LOV which i created by selecting
    base data source:CCVO, list datasource:countryVO
    mapped attribute:country_id, display attrib:country_nme
    similarly,city LOV which i created by selecting
    base data source:CCVO, list datasource:cityVO
    mapped attribute:city_id, display attrib:city_nme
    objective:
    now i need to populate the city LOV based on the country selected.
    i added valueChangeListener on countryLOV so that it will get the country_id and execute view criteria on cityVO
    problem:
    problem is that i can not get country_id value! i explored methods on the selectOneChoice variable accessor and ValueChangeListerner component but no luck!
    as i am displaying the country_nme so i have to use DCIteratorBinding to actually reach to the country_id value.
    this seems to be a tedious way! plus if country selected again it gives nullPointerException on 3rd line:
    DCBindingContainer dcBc = (DCBindingContainer)getBindings();       
    DCIteratorBinding  iter = dcBc.findIteratorBinding("CountryVO1Iterator");    
    Row row = iter.getRowAtRangeIndex(vce.getNewValue().toString()); //[error-prone] first time returns the database row of the selected country record.gives exception on 2nd time
    Q1. is there any direct way of getting country_id, based on the display name?
    Q2. is there any way to refresh the iterator? iter.release(), iter.clear() did not help
    Regards,
    Rabs

    Hi
    This is not possible in Discoverer 4i. The concept of Cacading lists of values was only introduced in Discoverer 10g R2 (10.1.2).
    Now there's a good reason to upgrade :-)
    Best wishes
    Michael

  • How to create an lov based on another lov?

    For example, the first lov is a list of regions like east, west....
    When I pick 'east', then i want the next lov to just show all the employees in the 'east' region.
    Thanks

    Hi
    This is not possible in Discoverer 4i. The concept of Cacading lists of values was only introduced in Discoverer 10g R2 (10.1.2).
    Now there's a good reason to upgrade :-)
    Best wishes
    Michael

  • How to set the focus to a first element in oracle apex 3.2.1  and 3.1.2.00

    Hello ,
    I am using oracle apex 3.2.1 in development env. How to set the focus to a first element of a page.
    thanks/mahesh

    Hi,
    This might help
    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/bldr_pgs.htm#CJGJDHCI
    Find "Cursor Focus" from page Display Attributes
    Br,Jari

  • How to hide and show button based on if row is selected in tabular form

    Hi,
    Im pretty new to apex. I am using version 4.1. I have a tabular form and what i want to do is only have the delete button show if i select a row from the [row selector] column. Can this be done using a dynamic action? I have tried it that way unsuccessfully. Please help or let me know if you need any more information.
    Thanks

    Do you mean if the check box is selected in the row?
    Assign a static ID to the delete button, e.g. MY_DEL_BTN. Look for "Static ID" under the Attributes section of the button.
    If so, make an advanced Dynamic Action based on Click and a jQuery selector. Usually, this element is name "f01" but, you need to make sure. Assuming it is "f01" then your jquery selector would be:
    input[name="f01"]set the event scope to live.
    Your dynamic action will fire JavaScript. (BE SURE TO UNSELECT FIRE ON PAGE LOAD). To make sure you have the right jQuery selector, at first just put a pop up message in the JavaScript.
    alert('You Clicked the Row Selector!');Run the page. Click the row selector. If you get the pop up you have specified the jQuery selector correctly. Yay!
    Then, assuming the above is correct. You can now determine if any have been selected.
    Now, set it back to SELECT TO FIRE ON PAGE LOAD (You want the delete to be hidden when you first open the page).
    Change your JavaScript to this:
    var checkedCnt = $("input:checked").length;
    if( checkedCnt > 0 )
       $('#MY_DEL_BTN').show();
    else
       $('#MY_DEL_BTN').hide();
    };-Joe

  • Set a LOV based on another LOV when the parent value is NULL

    Application Express 4.1.1.00.23
    Oracle Database 11g
    I have two Select Lists (LOV 1 and LOV 2) Items of several other items in a HTML region. LOV 2 is based on value in LOV 1 which is perfectly working. But I need to display some values in LOV 2 when value in LOV 1 is null which is not working at all. Any help is appreciated.
    Thanks,
    Sam

    Hi Sam,
    Sam82 wrote:
    Application Express 4.1.1.00.23
    Oracle Database 11g
    I have two Select Lists (LOV 1 and LOV 2) Items of several other items in a HTML region. LOV 2 is based on value in LOV 1 which is perfectly working. But I need to display some values in LOV 2 when value in LOV 1 is null which is not working at all. Any help is appreciated.
    Edit your LOV2 and do the changes suggested below
    Cascading LOV Parent Item(s) : LOV1
    Optimize Refresh : No (this is important not forget to make it NO)
    List of values definition : try to use query similar like this
    IF :P2_LOV1 IS NULL THEN
    RETURN 'select ENAME as display_value, EMPNO as return_value  from EMP';
    ELSE
    RETURN 'select ENAME as display_value, EMPNO as return_value  from EMP where  DEPTNO = :P2_LOV1';
    END  IF;
    Hope this will works for you,
    Regards,
    Jitendra

  • Displaying second parameter based on first parameter

    Dear Developers,
    In the parameter form or reports, I want to pass value selected
    in the first parameter to the second parameter
    ie. based on the first parameter selected, I would like the
    query written in the second parameter for
    displaying list to display only those values that are associated
    with the first parameter.
    How can I do this?
    I do not want to call report from form with preselected
    parameters.
    Awaiting speedy reply
    Gaurav

    You can't do this in Reports. You need to do it in Forms

  • How to refresh values in second messagechoice based on first messagechoice?

    Hi All,
    We had a requirement where we need to populate values into second messagechoice item based on the value selected in the first messagechoice item.
    We need to take the value (first messagechoice) as output parameter and need to pass as input parameter to the second messagechoice VO.
    Can any please help me how to achieve the above.
    Regards,
    Sundeep

    Hi Sumit,
    Thanks for the reponse. I will go for the one you suggested.
    Can you please go through my new thread if you have time which is a very urgent requirement for me.
    Thread subject: "How to change VO's dynamically for a item for each row in advanced table?"
    Regards,
    Sundeep.

  • How to refresh page after selecting value from LOV item , in a tabular form

    Hi ,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, couple of issues here.
    1.
    2nd item(column) in tabular form, that LoV should get populated based user's selection value in first item LoV. So how do i refer to the value, that user selected in first item's LoV? I will have to use this reference in LoV query of my 2nd item ( on this tabular form)
    2.
    How can we refresh the page, when user selectes value in first item ( from LoV). As this is a tabular form, here item type is Select List, we dont have an option to pick item type as Select List with Submit. So problem is that when user selects value for item 1, refresh does not happen and item 2 LoV does not get populated as per user's selection in item 1.
    Please help here. Would be really appreciated.
    Thanks and Regards,
    Rave.

    Thanks Ben and Dan for your responses.
    Ben, your solution helped me with refresh of page, as page got submitted.
    This answers to my 2nd question. However, I still need to know first question, which basically is, how do i refer to the value, that user selected in first item LoV.
    Issue is, I selected the value in first item LoV, it got submitted and page fot refreshed. But after page refresh, first item LoV loses its value that I had selected last time. It does not retain the selected value after refresh.
    I have an unconditional process, that on every submit(refresh) of page, I set my items with their corresponding values. But problem is what do i mention there to refer to this item.
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Any help here would be really appreciated. Please suggest how do we refer to this item's selected value.
    Thanks and Regards,
    Ravi.

  • How to retain value in LoV item in Tabular Form, after Page Refresh

    Hi,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, 2nd item(column) in tabular form, that LoV should get populated based on user's selection value in first item LoV.
    1. So how do I refer to the value, that user selected in first item's LoV? I will have to use this value as reference in LoV query of my 2nd item ( on this tabular form)
    2. Everytime I select value in first item LoV, page gets refreshed, as my requirement is to calculate 2nd item's LoV based on selected value in first item. So after this page refresh, first item LoV loses its value that was selected before the page refresh happened. So how do i retain this value in first item LoV? I have an unconditional process, that on every submit(refresh) of page, I set all my items with their corresponding values. But problem is what do i mention there to refer to this first item ( of type LoV) of tabular form?
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Please help.
    Thanks and Regards,
    Ravi.

    Hi Rave,
    You will have to use Javascript and Ajax to change the values as ApEx submissions will lose your results unless they are saved into the database.
    Remember, that as you are using a tabular form there will be lots of items called f01, fo2, fo3 etc on the page (one per row).
    Regards
    Michael
    Edited by: MKii on Jun 4, 2009 10:13 AM

  • Tabular form with Popuv LOV doesn't work with onchange event

    Hi all.
    I have a problem with tabular forms, Popuv LOVs and javascript.
    I have created one tabular form, I want to put a value in "my_field" field when a user selects a new value from other field called "my_list", I have this code:
    <script type="text/javascript">
    function putValue(pThis)
        var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
        html_GetElement('f06_'+vRow).value = '0000';
    </script>and this for Element Attributes:
    onchange="putValue(this);"Everything works well when I choose "Display as Text Field", but if I change this option to "Display as Popup KEY LOV" or "Popup LOV" it doesn't work, I mean "my_field" stays without any value.
    I'm using Oracle Application Express Release 4.0 and Oracle 11g
    Please help.
    Regards.

    Hi Peter.
    Thanks, yes, in fact the position of my column changes, but it doesn't work even with the correct element, I have made a lot of proves and it seems that APEX constructs POPUPS LOVS in a different way and that's why "onchange" does not work.
    With this thread: Re: onchange not work on popup lov for a field on collection I have a half solution, It works for existing rows, but it doesn't for added rows.
    I have solved this problem calling a function that set the onchange event to every row when "ADD ROW" button is pressed, now it works without problems.
    Regards.
    Oscar.

  • Report based on selection criteria in an Apex collection

    For my current page I have to deal with a horrible "EAV" (Entity-Attribute-Value) table design like this:
    Employee ---< Attribute Value >-- Attribute
    So you might query who works in dept 10 and earns 20000 and was hired om 01-Jan-2007 like this:
    select emp.ename
    from emp
    join attribute_value a1 on a1.empno = emp.empno and a1.att_name = 'DEPT'
    join attribute_value a2 on a2.empno = emp.empno and a2.att_name = 'SALARY'
    join attribute_value a3 on a3.empno = emp.empno and a3.att_name = 'HIREDATE'
    where a1.att_numeric_value = 10
    and   a2.att_numeric_value = 20000
    and   a3.att_date_value = date '2007-01-01';(I said it was horrible!)
    But to make matters worse, the form for entering query criteria is also based on the attributes table as a tabular form:
    select apex_item.display_and_save(1,att_name) att_name
    ,      apex_item.text(2,null) att_value
    from   attributes
    where  att_type = 'EMPLOYEE';The user may enter values for any number of attributes and run the query. So in my example, there maybe be 0, 1, 2 or 3 criteria to use (or more when new attributes are added to the table).
    I can code the report query as a "PL/SQL body returning SQL query" and build a SQL string exactly like my example above - all literal values. Is there any way I could do it that uses bind variables? Given the variable number of bind variables I think I'd need to use DBMS_SQL, but would I be able to integrate that into an Apex report region source? Or is there another way?
    I'm open to any suggestions! (Except "redesign the database": much as I'd like to, I can't.)

    If you are sure of the number of attributes the user will be using as criteria is fixed and will not change, you should able to bind the literals to page items like:
    select emp.ename
    from emp
    join attribute_value a1 on a1.empno = emp.empno and a1.att_name = 'DEPT'
    join attribute_value a2 on a2.empno = emp.empno and a2.att_name = 'SALARY'
    join attribute_value a3 on a3.empno = emp.empno and a3.att_name = 'HIREDATE'
    where a1.att_numeric_value = :P1_dept_value
    and   a2.att_numeric_value = :P1_salary_value
    and   a3.att_date_value = to_date(:P1_hiredate_value,'YYYY-MM-DD');or
    select emp.ename
    from emp
    join attribute_value a1 on a1.empno = emp.empno and a1.att_name = :P1_att1_name
    join attribute_value a2 on a2.empno = emp.empno and a2.att_name = :P1_att2_name
    join attribute_value a3 on a3.empno = emp.empno and a3.att_name = :P1_att3_name
    where a1.att_numeric_value = :P1_att1_value
    and   a2.att_numeric_value = :P1_att2_value
    and   a3.att_date_value = to_date(:P1_att3_value,'DD-MM-DD');What happens when your user wants to add another attribute and use it as search criteria. You have to:
    1) add a JOIN clause to the SELECT
    2) add to the WHERE clause to the SELECT
    Warning personal opinion to follow: I would give up binding (i.e.. skipping parsing os the SELECT statement) for the flexibility of generating the SELECT at runtime. If the user adds a new attribute, then the PL/SQL code that assembles the SELECT statement would not have to be changed. All the meta data is stored in the database as to what the new column is and which column in the attributes table to use (ATT_NUMERIC_VALUE or ATT_DATE_VALUE). If your method of displaying the attributes and receiving the user's criteria is dynamic like my example, then you would not have to change the application at all for new attributes.
    Just my 2 cents worth of opinion,
    Mike

  • Implementing LOV based reports in ADF

    I'm a newbie to ADF and need to implement a ADF page where a change in LOV value will result in the following (without submit button) ...
    first case: refresh existing report (single report) which matches the new value.
    second case: show multiple reports based on LOV value. for certain LOV values, one report is shown, other LOV value, two reports should be shown. How to manage hide/show with different LOV values?
    Third case: Implementing a hierarchy report based on LOV value as connect by value in the query. How to implement hierarchica queries in ADF?.
    any ideas/pointers to examples are appreciated.
    Regards,
    Surya

    Hi,
    a LOV can be set to autosubmit its value change. Then in a ValueChangeListener that you configure on the LOV component pointing to a managed bean you can handle the selection change. You have access to the current selected value, which would e.g. allow you to query the business service for the reports to display. In addition calling AdfFacesContext.getCurrentInstance().addPartialTarget(ParentContainerThatDisplaysTheReports); you can partially refresh the are that contains the displayed reports.
    Have a look here: http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/toc.htm
    Look for ValueChange event handling and Partial Refresh
    Frank

  • Creating a LOV based in a Web Service

    Hey guys...
    I need to create a Lov based in a Web Service Result, but in always getting the same error:
    LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Queries that I'm trying:
    Original Query:
    select extractValue(value(t),'/*/imgLocation','xmlns="http://oracle.ovs.api/types/"') "imgLocation"
    , extractValue(value(t),'/*/imgName','xmlns="http://oracle.ovs.api/types/"') "imgName"
    from wwv_flow_collections c,
    table(xmlsequence(extract(xmltype.createxml(c.clob001),'//getAllTemplateResourcesResponseElement/result','xmlns="http://oracle.ovs.api/types/"'))) t
    where c.collection_name = 'P1_GETALLTEMPLATERESOURCES2_RESULTS'
    Other Query that I tried:
    select imgLocation, imgName from (
    select extractValue(value(t),'/*/imgLocation','xmlns="http://oracle.ovs.api/types/"') "imgLocation"
    , extractValue(value(t),'/*/imgName','xmlns="http://oracle.ovs.api/types/"') "imgName"
    from wwv_flow_collections c,
    table(xmlsequence(extract(xmltype.createxml(c.clob001),'//getAllTemplateResourcesResponseElement/result','xmlns="http://oracle.ovs.api/types/"'))) t
    where c.collection_name = 'P1_GETALLTEMPLATERESOURCES2_RESULTS')
    And I tried creating a view, but I dont know where I have to put this.. Maybe in another process?
    create view as
    select imgLocation, imgName from (
    select extractValue(value(t),'/*/imgLocation','xmlns="http://oracle.ovs.api/types/"') "imgLocation"
    , extractValue(value(t),'/*/imgName','xmlns="http://oracle.ovs.api/types/"') "imgName"
    from wwv_flow_collections c,
    table(xmlsequence(extract(xmltype.createxml(c.clob001),'//getAllTemplateResourcesResponseElement/result','xmlns="http://oracle.ovs.api/types/"'))) t
    where c.collection_name = 'P1_GETALLTEMPLATERESOURCES2_RESULTS')
    Thanks

    Fox,
    I'd start by adding column aliases D and R to the query and see if that helps.
    Greg

Maybe you are looking for

  • Internet Connectivity for Multi - vrfs

    Hi all, Some help needed with the scenario below; Am currently migrating our legacy IP network to MPLS.we have been able to migrate 3 seperate networks into their respective vrfs and currently only left with the internet segment which used to connect

  • Phone plug doesn't go in all the way.

    Phone plug stops before engaging all the way in.  Was fine for 1 year and suddenly stopped working.  Probed with tooth pick and seems to be free on any debris in hole.

  • How to uninstall Oracle 11g on Red Hat Enterprise Linux 5.3 x86-64

    I've install Oracle 11g on a Red Hat Enterprise Linux 5.3 x86-64 system. I'm new to the world of Oracle and I have come to the conclusion why learning about Oracle I've screwed up my in installation of Oracle 11g to the point where nothing Oracle rel

  • File Properties (Meta Data) and Indexing for your Portal

    Meta Edit™ Find what you need, when you need it. If you manage a large network or portal, chances are that there are thousands of documents floating around that are difficult to locate due to poor file property information. With MetaEdit™, it’s

  • IPad 2 Upgrade to iOS 5

    Haven't figured out how to update my iPad 2 to iOS 5. Been using instructions in Guide for iOS 5 -- "Install iOS 5."