LOVs in HtmlDB

Hi,
I am trying to create an LOV which returns multiple values.
For example: If I search for a name in the lov and select a particular name, then I want to return the phone number and email address as well as the name to the parent screen.
Can somebody share light on how to do it.
Thanks
-Venkat

Hi,
One method is to concatenate the required fields in your lov query, eg
SELECT name||' - '||telno||' - '||email_addr display_val, person_id
FROM person
ORDER BY 1
Cheers.

Similar Messages

  • Multi-record report: content LOV depending on value of current row

    I have a multi-record report based on a query.
    For each row in the report it should be possible to choose a value from lov.
    The content of the lov is depending on a field in the current row.
    Later on I will update a record based on the chosen value but that is not the
    issue right now.
    The problem I am facing is that I don't know how to refer in a list to a value
    from the current row.
    For example.
    In the example below it should be possible to choose (from the lov) a best buddy for
    an employee. The buddy should be an other employee working for the same department.
    So in the lov I must refer to the deptno from the current row. How is this possible???
    select empno
    , ename
    , deptno
    , htmldb_item.select_list_from_query
    ( 1
    , empno
    , 'select ename, empno from emp where deptno = #deptno# '
    ) buddy
    from emp

    Hi Scott,
    I've created this application "TestLov" at the site you mentioned.
    Application ID : 800
    Workspace Name : ANUWKSPC
    The first page has an employee report with the solution as suggested by Raju Mattamal in this thread. That query seems to work fine without any errors...(I'm surprised why I'm getting errors on my application with the same query, even though data appears?! Is it to do with some setting?)
    The second page has the report with my actual query. This is throwing errors.
    On the third page I've tried to implement the solution you've suggested in Tips & Tricks section of HTML DB Studio(Simulating a correlated sub-query in report LOVs)
    http://htmldb.oracle.com/pls/otn/f?p=18326:54:2188928890822530056::::P54_ID:1282
    This doesn't seem to work either.
    I'm unable to figure out the problem.
    Pls look into the application and let me know how I shld go abt this.
    Thanks in advance,
    Anu

  • Need help with this java thing

    i got a script for virtual keyborad but i don't know much javascript
    so need your help to fit this script to my htmldb application .
    i have page with textare name P2_MESSAGE_DESC
    i put the image near the textarea and i want the textarea to "get" what i type in the keyboard image.
    here is the hava script :
    <SCRIPT language=JavaScript>
    //This var is changed on Unload from talkback to 'false' in order to not generate this onUnload
    var DoUnload = true;
    //var theInputName = opener.document.myform.inputName.value;
    var theInputLength;
    function doInsert(theChar) { 
       opener.document.myform(opener.document.myform.inputName.value).value += theChar;
    function doDelete() {   
      theInputLength = opener.document.myform(opener.document.myform.inputName.value).value.length;       
      if(theInputLength > 0) {   
         if(opener.document.myform(opener.document.myform.inputName.value).value.substring(theInputLength-1,theInputLength)=="\n") {
              opener.document.myform(opener.document.myform.inputName.value).value = opener.document.myform(opener.document.myform.inputName.value).value.substring(0,theInputLength-2);
         } else {
              opener.document.myform(opener.document.myform.inputName.value).value = opener.document.myform(opener.document.myform.inputName.value).value.substring(0,theInputLength-1);
    function doSubmit() {
       //opener.document.myform.submit();
       window.close();
    </SCRIPT>
    <IMG height=159 src="#WORKSPACE_IMAGES#kbd.GIF" width=341 useMap=#HebMap border=0>
    <MAP name=HebMap>
    <AREA shape=RECT coords=272,94,297,120 href="javascript:doInsert('.')">
    <AREA shape=RECT coords=246,94,271,120 href="javascript:doInsert('&#1509;')">
    <AREA shape=RECT coords=220,94,245,120 href="javascript:doInsert('&#1514;')">
    <AREA shape=RECT coords=194,94,219,120 href="javascript:doInsert('&#1510;')">
    <AREA shape=RECT coords=168,94,193,120 href="javascript:doInsert('&#1502;')">
    <AREA shape=RECT coords=142,94,167,120 href="javascript:doInsert('&#1504;')">
    <AREA shape=RECT coords=116,94,141,120 href="javascript:doInsert('&#1492;')">
    <AREA shape=RECT coords=90,94,115,120 href="javascript:doInsert('&#1489;')">
    <AREA shape=RECT coords=64,94,89,120 href="javascript:doInsert('&#1505;')">
    <AREA shape=RECT coords=38,94,63,120 href="javascript:doInsert('&#1494;')">
    <AREA shape=RECT coords=286,67,311,93 href="javascript:doInsert(',')">
    <AREA shape=RECT coords=260,67,285,93 href="javascript:doInsert('&#1507;')">
    <AREA shape=RECT coords=234,67,259,93 href="javascript:doInsert('&#1498;')">
    <AREA shape=RECT coords=208,67,233,93 href="javascript:doInsert('&#1500;')">
    <AREA shape=RECT coords=182,67,207,93 href="javascript:doInsert('&#1495;')">
    <AREA shape=RECT coords=156,67,181,93 href="javascript:doInsert('&#1497;')">
    <AREA shape=RECT coords=130,67,155,93 href="javascript:doInsert('&#1506;')">
    <AREA shape=RECT coords=104,67,129,93 href="javascript:doInsert('&#1499;')">
    <AREA shape=RECT coords=78,67,103,93 href="javascript:doInsert('&#1490;')">
    <AREA shape=RECT coords=52,67,77,93 href="javascript:doInsert('&#1491;')">
    <AREA shape=RECT coords=26,67,51,93 href="javascript:doInsert('&#1513;')">
    <AREA shape=RECT coords=247,40,272,66 href="javascript:doInsert('&#1508;')">
    <AREA shape=RECT coords=221,40,246,66 href="javascript:doInsert('&#1501;')">
    <AREA shape=RECT coords=195,40,220,66 href="javascript:doInsert('&#1503;')">
    <AREA shape=RECT coords=169,40,194,66 href="javascript:doInsert('&#1493;')">
    <AREA shape=RECT coords=143,40,168,66 href="javascript:doInsert('&#1496;')">
    <AREA shape=RECT coords=117,40,142,66 href="javascript:doInsert('&#1488;')">
    <AREA shape=RECT coords=91,40,116,66  href="javascript:doInsert('&#1512;')">
    <AREA shape=RECT coords=65,40,90,66  href="javascript:doInsert('&#1511;')">
    <AREA shape=RECT coords=39,40,64,66 href="javascript:doInsert('\'')">
    <AREA shape=RECT coords=13,40,38,66 href="javascript:doInsert('/')">
    <AREA shape=RECT coords=303,14,328,39 href="javascript:doInsert('0')">
    <AREA shape=RECT coords=277,14,302,39 href="javascript:doInsert('9')">
    <AREA shape=RECT coords=251,14,276,39 href="javascript:doInsert('8')">
    <AREA shape=RECT coords=225,14,250,39 href="javascript:doInsert('7')">
    <AREA shape=RECT coords=199,14,224,39 href="javascript:doInsert('6')">
    <AREA shape=RECT coords=173,14,198,39 href="javascript:doInsert('5')">
    <AREA shape=RECT coords=147,14,172,39 href="javascript:doInsert('4')">
    <AREA shape=RECT coords=121,14,146,39 href="javascript:doInsert('3')">
    <AREA shape=RECT coords=95,14,120,39  href="javascript:doInsert('2')">
    <AREA shape=RECT coords=69,14,94,39   href="javascript:doInsert('1')">
    <AREA shape=RECT coords=13,14,67,39 href="javascript:opener.nextField()">
    <AREA shape=RECT coords=273,40,328,66 href="javascript:doDelete()">
    <AREA shape=RECT coords=78,121,258,147 href="javascript:doInsert(' ')">
    <AREA shape=RECT coords=272,121,327,147 href="javascript:doInsert('\n')">
    </MAP>i just need to figure out the :
    opener.document.myform(opener.document.myform.inputName.value).value += theChar;
    how to change it to my p2_message_desc ?
    thanks

    thanks carl ,
    i changed it to:
    document.getElementById('P2_MESSAGE_DESC').value += theChar;
    and it put me the keyword in the textarea.
    one problem left :-(
    i want it to put the keyword where the cursor is for example
    if i have this sentence in my textarea:
    i love oracle htmldb application
    and cursor is before htmldb word and i enter the word (push the virtual keyboard bottons):
    develope
    the sentence will be:
    i love develope oracle htmldb application .
    now if i do that i'm getting:
    i love oracle htmldb application develope.
    i hope you get my point.
    thanks

  • HTMLDB 2.0 bug - tabular forms - select list from named LOV

    Hi!
    Changing a column in a tabular form to 'select list (named lov)' gets the following error in HTMLDB 2.0 when you try to add a row (to an empty table in my case):
    PL/SQL error at column 133.
    Create a table and then create a tabular form on it. Then change a report column to be a 'select list (named lov)'. Save and run the form and the error occurs.
    Thanks!
    Dave Venus

    Brian,
    This example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:176
    and this example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:160
    may help you.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • HTMLDB 1.6 Popup LOV navigation not working

    Hi all,
    I've recently migrated from 1.5 to 1.6.
    The pop-up LOV's navigation buttons (ie: Next) do not work. I click them but nothing happens. Any ideas?
    This happens regardless of the query used...
    Thanks...

    Thanks! That did solve the problem;
    The problem resides in the Popup LOV template. Under the field "Next button text" the default value is Next &gt(ampersandgt) <-- substitution is occuring on the screen);
    And "Prev Button text" value is &lt(ampersandlt); Previous
    If you remove the "&lt" or "&gt" from each of these the pagination works properly.
    I decided to look into a different template, my template was Template 3, business look. I checked out Template 9 and it used a different value "< Previous" I pasted this into my template and it worked. Looks like the "& gt or lt substitution " conflicts here...

  • I love HTMLDB

    Just wanted to give HTML DB and this forum some love... I just finished an incredibly complex screen, doing things I wasn't even sure were possible with the tool... All this was made possible basically by researching this forum...
    Thanks ya'll...

    Dan,
    Nice to hear things are going well. Can you tell us a little bit more about what you're working on? Also, are you on the HTML DB World Map yet?
    http://www.frappr.com/htmldbusers
    Sergio

  • Null value handling in LOVs

    Has null value handling improved any in HTMLDB 1.6?
    If my LOV has "Display null"=Yes (default null value is %null%) and I need to pass in a database NULL to a After Submit process, I need to do add a After Submit computation for each of these LOVs with something like
    CASE WHEN :P1_ITEM='%null%' THEN NULL ELSE :P1_ITEM END
    I have a couple dozen LOVs on a page and it is getting tiring to go and do this on each and every one!
    Is there a better way?
    Thanks

    Hi Patrick,
    we are currently moving over to Apex 4.02 and are doing some smoke tests on our existing apps.
    I have come across an issue with your generic solution to the %null% issue above (incidently, for a long time it's the first piece of code I include when I start a new app... thank you!)
    We found that a lot of our SQL Query (PL/SQL function body returning SQL query) reports were failing due to the session state of the LOVs still having a session state of %null% even after the RemoveNulls application process had run.
    After debugging your generic process we found that the LOV_NULL_VALUE in the APEX_APPLICATION_PAGE_ITEMS view has changed from NULL to '%null%'.
    so the fix was as below:-
    BEGIN
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          IN (TO_NUMBER(:APP_PAGE_ID), 0)
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
    -- change here
               AND LOV_NULL_VALUE  = '%null' || '%'
        LOOP
            IF V(rItem.ITEM_NAME) = '%null' || '%'
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    END;Cheers,
    Gus.. (always a fan of your work!)

  • A problem with LOV and my query. Help to solve, please...

    Hello!
    Here is a query:
    SELECT FULLNAME||', '||(SELECT NAMEOFGROUP||', '||(SELECT CITY FROM CITY WHERE PRKEY=TLL.CITY) FROM GROUPS TLL WHERE PRKEY=TL.GROUPOF) t ,PRKEY r FROM MINEUSERS TL
    In SQL DEVELOPER it works fine. But in APEX - when I try to save my "SELECT LIST" - it falls with error - "If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query."
    How can I reassemble my query to fix this problem - I have no idea... :(
    Thanks

    You may create a pipelined function returning two values, display and return, to return
    the result from your query. After that, your LOV should work. See example here:
    http://htmldb.oracle.com/pls/otn/f?p=31517:146
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Problem of POP LOV  in a  SQL Report  with pagination

    I am using a pop up lov (along with some other fields), HTMLDB_ITEM.POPUP_FROM_LOV(5, null, 'EMPLOYEE_LIST', '20', '50')), in a sql report. This is a report with pagination. Whenever I select any value from pop up lov on first page of the report it gets populated properly in the corresponding text field. But from second page onwards it doesn’t populate any value.
    For example, my report fetches a total of 50 rows, of which I am displaying 15 at a time. The popup lov comes with a text field for each row. Whenever I do select from popup lov for 1-15 rows which come on page 1, the values come up in the text field properly, but for rows 16-30 on second page, 31-45 on third 46-50 on fourth the values do not get populated. When I changed the pagination settings to display 40 rows..the values were still coming properly on page 1(1-40 rows) and not on the next page. Any clues… how to resolve this problem?

    good find. this is a bug that has already been identified and will be corrected in the upcoming patch release for htmldb. a good work-around for now is to use the equivalent declarative options in the tool. so rather than coding your query like...
    select ename , HTMLDB_ITEM.POPUP_FROM_LOV(2, null, 'DEPARTMENT', '20', '50') as "department" from emp
    ...just code it like this...
    select ename , null as "department" from emp
    ...and then use the column attributes screen for your "department" column to indicate that you'd like that col to be rendered as a "Popup LOV (named LOV)" using your DEPARTMENT list of values.
    hope this helps,
    raj

  • Popup lov in a report is not working if I have an order by caluse

    I created a form manually using the document from the url:
    http://otn.oracle.com/products/database/htmldb/howtos/tabular_form.html#MANUAL
    I used the following query from that document.
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    This works fine.
    But if I add an order by clause to the query the popup key for mgr column doesn't work.
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    order by ename
    Is this a bug ?
    Is there a work around ?
    Thanks
    Chandra.

    Chandra,
    Please refrain from asking the exact same question twice. It doesn't help the quality of this forum. If you have to, "bump" an existing unanswered question up (wait a day or two, please) in case it fell through the cracks.
    Now for the answer:
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename d, empno r from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from (select * from emp order by ename)
    Use an inline view like in the example above to do the sorting first. If you sort a result set that includes Popup LOVS, then the Javascript used to populate the text fields doesn't work anymore.
    Sergio

  • How to edit data using a LOV list AND textfield for one Field

    I am trying to edit the templated edit from HTMLDB template when I create a new table. I implemented most of the fields with LOV list like yes/no, joe/bob/john etc. But some fields as many probably have seen have a LOV called "Other" where a person types a different value than the ones available. Can someone tell me how I can accomplish that? Do I need to insert "Other" into LOV and have it be set as the value in the textfield? I am not sure how i can create both LOV list and textfield per category/field i.e. Name.
    Thanks

    Again, I urge you to use HTML DB nomenclature to describe what you've done. For example: "I ran the Form on a Table wizard to create a form" Rather than using the word "template" for everything you describe. "Template" has a specific meaning in HTML DB and it is not what you are referring to.
    You really should invest the time required to accurately phrase your problem. Just like answering questions on this forum requires time, so does formulating your question. It is time well spent and it is effort on your part that the experts on this forum deserve. If you don't put in this effort and instead just post a stream of consciousness, that means the readers of this forum will gloss over your question and ignore it. As a result, you have to ask the question again...and again.
    Having said that, if I understand your question correctly, you should use a popup LOV item. This will allow the user to select from a list but will also allow typing of a non existent option into a text field.
    Sergio

  • Creating a dynamic lov based on a column

    Hi,
    I want to create a dynamic lov based on a column in a database-table.
    Eg. the query
    'select code, description from code_table'
    is the contents of the column 'lov_query' in the table 'parameters'.
    For every parameter there can be a different lov-query, but the result is always
    two columns (code and description, number and name, etc.), exactly what you need to use in a lov.
    I've written a (dbms_sql) function that takes the parameter-id and returns the lov_query.
    create or replace function "GET_PMR_LOV"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(2000);
    begin
    DBMS_SQL.PARSE
    (cur, 'select pmr.lov_query from parameters pmr where pmr.ID ' || ' = 'L_PMR_ID', DBMS_SQL.NATIVE);
    DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
    DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 2000);
    fdbk := DBMS_SQL.EXECUTE (cur);
    fdbk := DBMS_SQL.FETCH_ROWS (cur);
    IF fdbk > 0
    THEN
    DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
    return (l_stmnt);
    ELSE     
    return null;
    END IF;
    DBMS_SQL.CLOSE_CURSOR (cur);
    END;
    But now I'm stuck on how to pass on this statement in HTMLDB
    as an dynamic lov, I don't seem to be able to execute this statement
    into the two display and return columns. Any ideas?

    Hello again,
    This lov is on an updatable report-column where the user has to make a choice from an non-named, popup and query-based lov. In the lov-query box I have just put:
    "return get_pmr_lov(:p41_param_id)" (without the quotes ;-)
    Here's my latest version plus an alternative, which both seem to work fine:
    create or replace function "GET_PMR_LOV"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(1000);
    begin
    DBMS_SQL.PARSE (cur, 'select pmr.lov_query from paramaters pmr where pmr.ID ' || '= :L_PMR_ID', DBMS_SQL.NATIVE);
    DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
    DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 1000);
    fdbk := DBMS_SQL.EXECUTE (cur);
    fdbk := DBMS_SQL.FETCH_ROWS (cur);
    IF fdbk > 0 THEN
    DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
    return (l_stmnt);
    ELSE
    return null;
    END IF;
    DBMS_SQL.CLOSE_CURSOR (cur);
    END;
    create or replace function "GET_PMR_LOV2"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(1000);
    BEGIN
    EXECUTE IMMEDIATE 'select pmr.lov_query from parameters pmr where pmr.ID = :1'
    INTO l_stmnt USING l_pmr_id;
    return l_stmnt;
    END;
    The error-message remains the same, unable to bind :p41_param_id !

  • Cascading LOVs in a report region

    Can you create a cascading LOV in a report region? All of the examples I find are in a HTML region.

    Swosh,
    I think that this approach is better than the one from Vikas:
    http://htmldb.oracle.com/pls/otn/f?p=31517:176
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • LOVs in Print Friendly Mode

    Hi,
    I have a page item of type Display as Text (based on LOV, saves state). The page shows the display value ("Pending" in this case). However, when I launch the page in Print Friendly mode, it shows the return value ("2"), instead of the display value ("Pending").
    This also occurs for any other select lists on my pages if the select list is read only.
    Any ideas or workarounds?
    Thanks,
    Chaunaci

    yes, this does appear to happen for items of type "Display as Text(based on LOV, saves state)", but things seem to work fine for my select list items in the production version of htmldb. i'll log the issue in a bit, but two ways to work around it for now would be to:
    1) add an extra item to your page that would render correctly in printer friendly mode. use our built-in condition types of "Current Page Is in Printer Friendly Mode" and "Current page is NOT in Printer Friendly Mode" to determine which/when of your two items should be displayed.
    2) tweak your LOV query a little bit to pay attention to the api variable, htmldb_application.g_printer_friendly. it's a boolean that returns true if your app is in printer friendly mode.
    if you really are seeing this behavior with select list items, could you please provide more specifics as to how those items were set up?
    thanks,
    raj
    [Edited by: rmattama on Apr 1, 2004 1:26 PM]
    i now see the issue w/the select lists occurs in read-only mode. gotcha. didn't read that right the first time. i'll add this to the bug rpt.

  • Display 'No Data Found' message w/ htmldb PopUp

    Hi all,
    Is it possible to control message within htmldb PopUp Lov, sort of 'No Data Found' available in Report template under topic 'When No Data Found Message'?
    Thx
    lam

    hi
    you can create two region with conditions:
    1. Chart region (display if your qurey return values)
    2. Html region with static "Nothing to display" (display if your query no data found)

Maybe you are looking for