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.
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!
AstridWell, 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, '&','&');
:TF_SL_SEARCH := replace(:TF_SL_SEARCH, '<','<');
:TF_SL_SEARCH := replace(:TF_SL_SEARCH, '>','>');
:TF_SL_SEARCH := replace(:TF_SL_SEARCH, '"','"');
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 -
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
------------------------------------------------------------------- -
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] -
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
TonyDan,
Thanks. I haven't noticed this is missing. For the code i forgot to escape "<". ;)
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
------------------------------------------------------------------- -
Error when running Denes Kubicek auto complete
First off, Denes is a genius for creating this site: http://apex.oracle.com/pls/otn/f?p=31517:53:2299218646945201::NO:RP:: This is by far the best Application Express site I've ever seen.
Second, I'm having an issue with the Ajax Autocomplete (which is like the most awesome thing I've ever seen). Currently I'm running the 10g version so I'm not sure if that is causing the issue or what.
When I click on the search box and type something in, I'm getting the following error returned in firefox. The list is also empty. If I click on the list, I get the second error.
Error: html_GetElement(p_TextFieldName).parentNode is undefined
Source File: http://www.internalwebsite.com/s_htmldb/phap/wwv_flow_file_mgr.get_file?p_security_group_id=625114739298344&p_flow_id=217&p_fname=textfield_autofilter.js
Line: 20
Error: pColor is undefined
Source File: http://www.internalwebsite.com/s_htmldb/phap/wwv_flow_file_mgr.get_file?p_security_group_id=625114739298344&p_flow_id=217&p_fname=textfield_autofilter.js
Line: 111
Thank you for any suggestions anyone has.The instruction says:
In the footer of the region where your search item
is placed, enter the following:
<script language="javascript" type="text/javascript">
<!--
register("P53_ENAME", "EMP", "ENAME", "blue", "red");
//-->
</script>
My assumption is that some of the five parameters of the register function is not matching to whatever they should. You need to have those
five and the item, table and column names have to match to the existing item, table and column. Also, blue and red are colors. The color your specified needs to be a valid color. Check your sintax.
Thanks for calling me a genious but I am definitelly not one. The site you praise (once again thanks) is primarily a lot of work.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
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 LErwin,
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
------------------------------------------------------------------- -
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 -
Hi Folks,
i´m using one of the great examples of Denes Kubicek and have a question.
I have a textbox. let´s call it P1_CITY.
I enter some characters and it autocompletes the city. OK, works!
Example: MUNICH
But know i want to build a second textbox. let´s call it P1_STREET.
It would be nice to use the autocomplete function also (but now together with the city)
/* select distinct street from tab where street like '%....' and city='MUNICH'
My Problem is, that the Textbox P1_CITY dosn´t have i value (or i´m to stupid to reference it)
I tried :P1_CITY in the select but it´s empty. I looked into the session value, also empty. Where is my "city" :-)
After a reload of the page, the Textbox is also empty
Thanks
Marcosolved. thanks. there was a process deleting the session item values :-(
-
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 dataHi 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 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 lovMore 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 -- 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
k3kStart 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) -
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.
RegardsThis 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?
MichalMaybe Creator team could help?
-
JavaScript Show Hide Items (Shuttle) (Denes Kubicek)
Hello
I was looking at a great example from Denes Kubicek on this link (http://htmldb.oracle.com/pls/otn/f?p=31517:129:495210338999346::NO:::) Guest Apex_demo and have managed to get it to work.
However, I would like to show/hide a shuttle item. Any ideas how I could achieve this? It only seems to hide the selected values part of the shuttle and not the buttons/LOV.
Thank you in advanceHello,
In case of a shuttle item you need to use a label with ID, and use that ID as the parameter to the $x_HideItemRow() or $x_ShowItemRow().
The following post describe how to create a proper template for that purpose: Re: Hide and show item as per the value of select list .
Regards,
Arie.
Maybe you are looking for
-
When in iTunes if I try to change info such as song name while in the music library I get a 'send error report' messege and iTunes shuts down. I acctually I don't have to change anything just click in the field and when it turns blue which indicates
-
Thanks for your help!
-
Help on how to install msn and uninstall programmes!
i'm sorry if i seem rather dim from this, i promise i am not, just have a PC conditioned mind and finding it hard to negotiate my Mac. Firstly, when i try and install msn messenger it downloads the exe file, then when i try and open it it opens with
-
I have Nokia 700 and car handsfree Nokia CK-7W connected via bluetooth. The connection works fine, but there is one problem: When I connect it, the phone automatically lock the touch screen. Is there any possibility to leave the tou screen unlocked?
-
How to modify H.264 Video Files?
Hi, at first sorry for my bad english. I hope, you'll understand my request anyway. I produce live streamings of events with des FMS3 and the Flash Media Encoder 2.5 in the new H.264 format. Addionally I save the files (.f4v) on my local machine. Aft