Ajax autocomplete on a tabular column

Hello,
Is it possible to add the autocomplete functionm of denes on a tabular column and how can i do that?
Thanks for your help
I think the problem resides in referencing the item in the register function how can I pass the id of the object in the table?
Erwin
Message was edited by:
Erwin L

Erwin,
That is possible. See this example:
http://htmldb.oracle.com/pls/otn/f?p=31517:178
This works but not the way I would like to see it. The register function is creating a div and
a select list for the text filed you want to filter. If you later call an element which is above
the previously edited element, the select list will be broken by all the div's. I didn't have
time to find out how to remove the created div once the focus is lost. Perhaps there is
someone who would know the answer how to do that easily.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • Ajax Autocomplete Tabular does not work using apex_item.text in SQL Query.

    Hello,
    Is it possible to use the search function which is used in, Dennis Kubicek example, ENAME topic Ajax Autocomplete Tabular
    in a sql query using apex_items?
    Query line :
    , apex_item.text(17,xp.part_nr,null,null,'onfocus="f_register(this);" autocomplete="off"') PART
    At first I followed the example by adding 'onfocus="f_register(this);" autocomplete="off" in the element attributes in the report field.
    This didn't work... so tried to add the it in the attirbutes parameter of the apex_item.
    But this still doesn't work. No errors are given, it does not respond.
    Could somebody please help me?
    Thx!
    Astrid

    Well, I'm trying to take this one step further, but I seem to be having some difficulty.
    I'm trying to make a Filter screen to create a dynamic where clause filter screen.
    This is a page I made with Popup LOVS, just to show you my goal (now trying to use autofilters)
    http://apex.oracle.com/pls/otn/f?p=29989:5
    I have a table on my system that tells you where the field is, and I'm using that to get the table (didn't want to change the javascript, so I pass in a static value).
    This is the javascript code I used
    <pre>
    <script language="JavaScript" type="text/javascript">
    function f_register(p_this,p_name)
    var p_registered = $x('P5_ITEM_ID').value;
         var p_this_name = $x(p_this).id;
    //alert(p_this_name);
    if (p_registered != p_this_name)
    register(p_this_name, "COSTING_M", p_name, "blue", "red");
    $x('P5_ITEM_ID').value = p_this_name;
    </script>
    </pre>
    This is my query
    <pre>
    select column_name || apex_item.hidden(1,column_name) Col_name,
    apex_item.SELECT_LIST_FROM_lov(2,'=','OPERATOR') OPERATOR,
    apex_item.text (3,
    NULL,
    20,
    200,
    'onfocus="f_register(this,''' || column_name || ''');" autocomplete="off"',
    'f3_' || '#ROWNUM#',
    NULL
    ) value,column_id
    from user_tab_cols
    where table_name = 'COSTING_M'
    ORDER BY ROWNUM
    </pre>
    and here is my on-demand process
    <pre>
    declare
    TYPE CurTyp IS REF CURSOR;
    v_row varchar2(4000);
    rec CurTyp;
    V_TABLENAME NKW.UTFIELD_M.TABLE_NAME%TYPE;
    begin
    BEGIN
    SELECT TABLENAME INTO V_TABLENAME
    FROM NKW.UTFIELD_M
    WHERE FIELD_NAME = :TF_SL_COLUMN;
    EXCEPTION WHEN NO_DATA_FOUND THEN RETURN; END;
    :TF_SL_SEARCH := replace(:TF_SL_SEARCH, '&amp;','&');
    :TF_SL_SEARCH := replace(:TF_SL_SEARCH, '&lt;','<');
    :TF_SL_SEARCH := replace(:TF_SL_SEARCH, '&gt;','>');
    :TF_SL_SEARCH := replace(:TF_SL_SEARCH, '&quot;','"');
    owa_util.mime_header('text/xml', FALSE);
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<rowset>');
    open rec for
    'select distinct ' || :TF_SL_COLUMN || ' ' ||
    'from NKW.' || V_TABLE_NAME || ' ' ||
    'where '||:TF_SL_COLUMN||' like :1||''%'' ' ||
    'and rownum < 100 ' ||
    'order by '||:TF_SL_COLUMN
    using :TF_SL_SEARCH;
    loop
    fetch rec into v_row;
    exit when rec%NOTFOUND;
    htp.prn('<row>' || htf.escape_sc(v_row) || '</row>');
    end loop;
    htp.prn('</rowset>');
    end;
    </PRE>
    I made some slight mods to make the table dynamic from my source table (this is to grab master files when they exist and not to when they don't).
    I get my select list, but it's blank on all fields, any suggestions?
    thanks,
    Scott

  • Can Autocomplete return different (PK) column

    hi @all,
    to achieve autocomplete / autosuggest i use denes great example [Ajax Autocomplete|http://htmldb.oracle.com/pls/otn/f?p=31517:53:5080202988387359::NO] (thanks for that denes)
    but, as usual, my customer wants an additional feature:
    after using autocomplete for the column ename on the table emp he/she wants the value of the column empno to be returned into another page item. quite similiar to the behavior of the standard APEX LOV
    i already looked through the functions of "textfield_autofilter.js"; but didn't find an easy solution.
    any ideas are welcome.
    regards
    peter

    no answers :-(

  • AJAX AutoComplete problem with arabic

    I'm using Ajax AutoComplete component in my project by creating the String array (String[]) from a table created in database
    The Ajax AutoComplete component work fine with English data but when working with Arabic data it gives me an empty list...!!!!
    does any one know why this is happening with Arabic data?
    this is my code for creating the string array:
    public String[] getNames() {
            RowKey rowKeys[] = namesDP.getAllRows();
            names =  new String[rowKeys.length];
            for (int i = 0; i < rowKeys.length; i++) {
                namesDP.setCursorRow(rowKeys);
    names[i] = namesDP.getValue("NAME").toString();
    return this.names;
    }NAME is the field that holds the English data and for Arabic i just change it to NAME1 which holds the Arabic data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi There,
    Creator will be EOLed soon, Netbeans is the latest version of Creator. Pls post your question on NB mailing lists at http://www.netbeans.org/community/lists/top.html for better response.
    Thanks
    K

  • Ajax autocomplete but using onclick.

    Hi,
    I've been using the ajax autocomplete functionality on a text item as described in Denes' website:
    http://htmldb.oracle.com/pls/otn/f?p=31517:53
    However I've been given a requirement to change it so that as soon as a user clicks into the field and before they type anything they see a complete list of the options available to them below. (The reason I don't use a select list is the user could still type their own input, the list just provides a guide of regularly chosen options).
    I've been looking at the code and scratching my head as to how to acheive this. I tried converting it to run using an onClick trigger, but failing. I'm basically trying to fool the javascript by giving the event a key if the key is null. This is not working as the process works off a keypress and I'm not sure on how the event object(?) in javascript works. Does anybody have any ideas/examples on this?
    Thanks,

    Hi,
    Try amending the textfield_auotfilter.js file :-
    Replace
       if (document.all) {
         html_GetElement(p_TextFieldName).onkeyup = function () {return showSelectList(event);};
       } else {
         html_GetElement(p_TextFieldName).onkeyup = function (e) {return showSelectList(e);};
    With
       if (document.all) {
         html_GetElement(p_TextFieldName).onkeyup = function () {return showSelectList(event);};
         html_GetElement(p_TextFieldName).onfocus = function () {return showDefaultSelectList(event);};
       } else {
         html_GetElement(p_TextFieldName).onkeyup = function (e) {return showSelectList(e);};
         html_GetElement(p_TextFieldName).onfocus = function (e) {return showDefaultSelectList(e);};
    Replace
    function showSelectList(e) {
       var keynum;
       var p_TextFieldName;
       if(document.all)  {
         keynum = e.keyCode
         p_TextFieldName = e.srcElement.getAttribute("id");
       } else {
         keynum = e.which
         p_TextFieldName = e.target.getAttribute("id");
       if (v_oldValues[p_TextFieldName] != html_GetElement(p_TextFieldName).value) {
         v_oldValues[p_TextFieldName] = html_GetElement(p_TextFieldName).value;
         if (html_GetElement(p_TextFieldName).value != "") {
           do_showSelectList(p_TextFieldName);
         } else {
           removeSelectList(p_TextFieldName);
       } else {
         if (keynum == 40 || keynum == 38 || keynum == 9) {
           if (!e.shiftKey) {
             if (html_GetElement("_"+p_TextFieldName+"SELECTLIST")) {
               html_GetElement("_"+p_TextFieldName+"SELECTLIST").focus();
         if (keynum == 13) {
           do_pushBackValue(p_TextFieldName);
    With
    function showSelectList(e) {
       var keynum;
       var p_TextFieldName;
       if(document.all)  {
         keynum = e.keyCode
         p_TextFieldName = e.srcElement.getAttribute("id");
       } else {
         keynum = e.which
         p_TextFieldName = e.target.getAttribute("id");
       if (v_oldValues[p_TextFieldName] != html_GetElement(p_TextFieldName).value) {
         v_oldValues[p_TextFieldName] = html_GetElement(p_TextFieldName).value;
         if (html_GetElement(p_TextFieldName).value != "") {
           do_showSelectList(p_TextFieldName);
         } else {
           do_showSelectList(p_TextFieldName);
       } else {
         if (keynum == 40 || keynum == 38 || keynum == 9) {
           if (!e.shiftKey) {
             if (html_GetElement("_"+p_TextFieldName+"SELECTLIST")) {
               html_GetElement("_"+p_TextFieldName+"SELECTLIST").focus();
         if (keynum == 13) {
           do_pushBackValue(p_TextFieldName);
    Add
    function showDefaultSelectList(e) {
       var keynum;
       var p_TextFieldName;
       if(document.all)  {
         keynum = e.keyCode
         p_TextFieldName = e.srcElement.getAttribute("id");
       } else {
         keynum = e.which
         p_TextFieldName = e.target.getAttribute("id");
       if (html_GetElement(p_TextFieldName).value == "") {
           do_showSelectList(p_TextFieldName);
    }Regards
    Paul

  • Ajax Select Value + Ajax Autocomplete - using both on same item

    I am really loving this ApEx demo application as it is teaching me TONS of new things.
    It is by far the most helpful apex lesson site I have found:
    http://htmldb.oracle.com/pls/otn/f?p=31517:80
    I have a question regarding two of these lessons:
    Ajax Select Value
    Ajax Autocomplete
    I want to use these two for the same item.
    I have got both to work correctly individually.
    Here is my scenario:
    I have a <name> field that auto completes.
    It will set the <credit_limit> page item, according to what this <name> field has.
    The problem:
    Typing in the name without using the auto complete feature works as it displays the <credit_limit>.
    But, when I choose the name from the generated select list, it returns null.
    If I then remove a letter from the <name>, retype it (without selecting it from the list), tab; it will display the <credit_limit>.
    Any idea how to fix this?
    I want to be able to select the <name> from the auto complete select list and have it fill out the <credit_limit>.
    I found a post that might be related to this problem:
    Application Process is not fired when selecting from popup lov

    More information:
    P20_NAME_TX
    HTML Form Element Attributes: onKeyPress="checkEnter(event)" autocomplete="off" onChange="f_getPurchaseOrderCreditLimit()";
    I have also tried without the onKeyPress:
    autocomplete="off" onChange="f_getPurchaseOrderCreditLimit()";
    (It still functions the same without this except the enter key does not do anything; what does onKeyPress="checkEnter(event)" do?):
    HTML Header
    <script type="text/javascript" src="#WORKSPACE_IMAGES#textfield_autofilter.js"></script>
    <script language="javascript">
    NS4 = (document.layers ) ? true : false;
    function checkEnter(event)
    var code = 0;
    if (NS4)
    code = event.which;
    else
    code = event.keyCode;
    if (code==13)
    doSubmit('SEARCH');
    </script>
    <script language="JavaScript" type="text/javascript">
    function f_getPurchaseOrderCreditLimit ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getPurchaseOrderCreditLimit',0);
    get.add('P20_NAME_TX',html_GetElement('P20_NAME_TX').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P20_CREDIT_LIMIT_CY').value = gReturn  }
    else
    {  html_GetElement('P20_CREDIT_LIMIT_CY').value = 'null'  }
    get = null;
    </script>

  • AJAX Autocomplete: HTMLDB_Get is not defined...

    Hello,
    I have tried to implement the AJAX Autocomplete example from Denes Example Applications, but get the following error message (by firefox):
    "htmldb_Get is not defined" !
    I had a look at several posts here, but could not solve the problem.
    I am still working with Apex V1.6 ! Is that a problem?
    I tried to find the appropriate .js-file with the "htmldb_Get" function in order to put it in my workspace and reference it, but firstly I am not sure if I got the right one and secondly it should work without that as it should already be implemented, isn't it!?
    Thanks for your help!
    Johnny
    P.S.
    When I type in anything into the textfield it just gives me an empty list....without content !!

    Johnny Be Good from Hamburg,
    Where is the corresponding .js file stored? On the file system or uploaded into your workspace? If it is in the workspace, is it associated with any application?
    I had the same problem for some reason and got a tipp to look at that detail.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Ajax Autocomplete -- all links open in new windows

    Hi
    I used Ajax Autocompete in one of my applications. But after i click the link which uses ajax autocomplete, strange behaviour is happens with other links in Internet Explorer. The other links that are supposed to be opened in the same window now start opening in new windows. This does not happen in Firefox. can someone suggest a reason and a solution to this problem.
    Thanks in advance
    k3k

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * [[Troubleshooting extensions and themes]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)

  • IE issue with Ajax autocomplete

    Hi,
    I'm using the Ajax autocomplete function as described at http://htmldb.oracle.com/pls/otn/f?p=31517:53:3795080723385850::NO (Denes Kubicek). Everything works fine except that when I use IE7, I can't save the field information into the database (save on button click). Every other fields are correctly saved. I tried with Firefox and Opera and it works perfectly. My concern is that our end users only use IE7 at work.
    Any idea why this happens?
    Thanks.

    Jen,
    My name is Jeff Canepa.  I work at Adobe as a Software Quality Engineer.  I am unable to reproduce the problem you describe.  Would it be possible for you to add me as a Co-Author ([email protected]) of your form so I can take a look at it's design?  If you are not comfortable with this then perhaps you could export the design template file (FCDT) and email it to me?  In addition, any more information you might be able to provide regarding the systems of those that are getting the error would be helpful (OS version, PC/Tablet, file they tried to upload).
    Regards,
    Jeff Canepa
    Jeff Canepa
    Software Quality Engineer
    Adobe Systems, Inc.
    [email protected]

  • Problems using Ajax-AutoComplete with FireFox

    Hello
    I'm trying to use the JSF-Ajax AutoComplete (java 1.4) with the FireFox with no success. The errors, according to the firefox console, is: BPUI IS NOT DEFINED.
    The DIV does`t show and the backing method responsible to do the completion result was`t called.
    This situation does`t occur with IE.
    i appeciate any help.
    Regards

    This is most likely more of a Dragon problem than Firefox. I would suggest also opening a ticket on their end to. Most likely it just is not familiar with new versions of Firefox and has yet to be updated.

  • Ajax autocomplete component in page fragment

    Hi
    I've used ajax autocomplete field in page fragment (for searching) but it's only visible on one page. How to make it visible everywhere?
    Michal

    Maybe Creator team could help?

  • Ajax autocomplete problems

    Hi
    On my oracle workspace I have tried to get Denes Kubicek Ajax Autocomplete example to work.
    After searching the threads the nearest I can get to making the example work is:
    type in a letter and this displays a select list which is blank.
    The select statment used for the select list seems to be OK.
    I have been trying to solve this but as I am a beginner at using Firebug to debug I am not having much luck
    regards
    Tony

    Dan,
    Thanks. I haven't noticed this is missing. For the code i forgot to escape "&lt;". ;)
    It is now fixed.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Ajax Autocomplete (Denes Kubicek)

    Hi,
    I am using Denes Kubicek examples for Ajax Autocomplete:
    http://htmldb.oracle.com/pls/otn/f?p=31517:53:2727115168911885::NO
    The example works great for one text field, but I am trying to see if it works for two text fields.
    I added this to the region footer.
    <script language="javascript" type="text/javascript">
    <!--
    register("P3_ENAME", "EMP", "ENAME", "blue", "red");
    register("P3_DEPT", "DEPT", "DNAME", "blue", "red");
    //-->
    </script>
    But that didn't work.
    Can this be done?
    Thanks
    VC

    Hi Denes,
    Forget my previous post.
    Here is the javascript code I placed in the Page Header:
    <script language="JavaScript" type="text/javascript">function f_register(p_this){
              var p_this_name = $x(p_this).id;                    
              //alert(p_this_name);                    
              if (p_this_name == 'P3_ENAME')                         
              alert(p_this_name);                         
              register("P3_ENAME", "EMP", "ENAME", "blue", "red");
              else { register("P3_DEPT", "DEPT", "DNAME", "blue", "red");
    }</script>I can't enter any data in the text field with the onFocus element.
    Not sure what I am doing wrong.

  • APEX Ajax Cascading Select List Tabular

    Hi everyone,
    We’re developping in APEX 4.X.
    I went to your blog « Denes Kubicek - ApEx Solutions », it’s very interesting
    http://apex.oracle.com/pls/otn/f?p=31517:176:384744492803038:::::
    I tried to create something as Mr Kubicek did to get an Ajax Cascading Select List Tabular.
    In step 5, he says the rest of the code if you apply for an account". Do we need to add a lot of code to get success ?
    Is there someone who tries to do like Mr Kubicek did ?
    Thanks in advance. Bye.
    Eric.

    Hi everyone,
    I looked at Mr Kubicek solutions about tabular form and I asked him to get access to his workspace. But I’m not sure to get all I need.
    I have a two select list named Activities and Entity. I want that Entity depends on Activities. Those list values come from respectively table h4_activities and h4_activity_entity.
    But, when I show the tabular form, I want to see records which is in table h4_activity_day. I don’t want to see only my two select lists.
    I think tabular form should be interesting.I want your advice.
    But, I need something like a select list with a LOV and SOURCE.
    Thanks in advance.
    Have a great day. Bye
    Eric

  • Need help! Can't validate date overlaps for a tabular column

    Hello all,
    The validation I created to validate whether new or updates rows does not overlap with any records in the table isn't working.
    The columns are StartDt and EndDt
    Validation Type: NOT EXISTS
    Validation expresion:
    select 1
        from  sample S
        WHERE S.STARTDT BETWEEN :STARTDT AND :ENDDT
    OR(S.ENDDT BETWEEN :STARTDT AND :ENDDT)
    or (S.STARTDT <= :STARTDT and S.ENDDT >= :ENDDT)
    or (:STARTDT <= S.STARTDT and :ENDDT >= S.ENDDT)
    Error Message:
    Times overlap
    When Buttons pressed
    -Select Button-
    The validation works if a new row or updated row overlaps any existing start and end date records but it doesn't work if I update startdate and end date rows that doesn't overlap existing date times
    Example:
    TABLE DISPLAYS THE FOLLOWING RECORDS
    NAME                   START DATE                      END DATE
    TEST                    1/1/2012                               12/31/2012
    If I update the rows to the following values, I receive an error message (although those values don't overlap any records in the table)
    NAME                   START DATE                      END DATE
    TEST                    6/1/2012                               10/30/2012
    Any ideas? Do I need to change my code?
    Click the link to view the answer to this question. Need help! Can't validate date overlaps for a tabular column
    Message was edited by: CharlieMack

    Logic for date range overlap testing only requires two conditions in the WHERE clause:
    ORACLE-BASE - Overlapping Date Ranges
    WHERE S.STARTDT <= :ENDDT AND S.ENDDT >= :STARTDT -- TRUE for ranges that overlap
    It looks a little odd, but, if you scribble out a 'logic table', it makes sense.
    Condition
    A.start <= B.end
    A.end >= B.start
    A__A B--B
    true
    false
    A__B=A--B
    true
    true
    A__B==B__A
    true
    true
    B--A==B__A
    true
    true
    B--B A__A
    false
    true
    MK

Maybe you are looking for

  • Lost all data. How to get back information from iCloud.

    Hello everyone! My iPhone updated itself and deleted all my messages, mailbox, what's app. I guess it happened because I had got a new iOS7  before. How can I get back all information using iCloud? Would be great if you help to find a solution! Thank

  • Can I get some help with ibooks?

    ok I have several questions. 1: do I have to own/use a Mac or any other kind of computer from apple to be able to sell books on ibooks? 2 What kind of files do ibooks support? can I sell odt files on it? 3 how much money do apple get from the sales?

  • Problem : com.ms.security.SecurityExceptionEx

    I don't find the solution about my problem: I have a JApplet, any problem when I compile. BUT in internet explorer I have this exception : com.ms.security.SecurityExceptionEx .... please help me....

  • Why is jar packaging needed to access package visibility members?

    javax.swing.text.html.HTMLDocument has (default) package access level members (eg base). Simply creating a class in the javax.swing.text.html package does not give me access to the package members of HTMLDocument. However, if I jar my class with the

  • HT201178 how can i turn on bluetooth if my keyboard is not working

    My keyboard and my mouse are not working for my Mac. Both the lights blink, indicating that they are ready to be paired but how do I turn on the blue tooth option on my computer if I can not navigate with my unresponsive keyboard?