salut tous;
i'm doing here an autocompletion module in the envirnment (XFORMS/XHTML).
this is a part of the JS code:
the strange thing is that if i remove the alert("ouf") nothing work.
have you an idea about this pb.
Thanks
@all:sorry if i use english,you can responde in frensh i will understand.
Modifié par moez (05 Oct 2006 - 12:08)
i'm doing here an autocompletion module in the envirnment (XFORMS/XHTML).
this is a part of the JS code:
<![CDATA[
function affiche1()
{
var model = document.getElementById("myModel");
var instanceDoc = model.getInstanceDocument("myInstance");
var sel = document.getElementById("__itemList");
sel.addEventListener("keyup",g,true);
}
function g()
{
//alert("ouf")
changeModel1(1)
}
function changeModel1(count1)
{
vider()
var found=new Array()
var model = document.getElementById("myModel");
if(model != null)
{
var inst = model.getInstanceDocument("myInstance");
if(inst != null)
{
var insertPoint = inst.getElementsByTagName("itemlist").item(0);
var itemCount = insertPoint.getElementsByTagName("item").length;
var k=0;
if(k<count1)
{
var element1 = inst.evaluate('//instanceData',inst, null, XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;
var element = inst.evaluate('//instanceData/@selected',inst, null, XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;
found=search(element.textContent)
//alert(element.textContent);
vider()
//alert(found.length)
for(x=0;x<found.length;x++)
{
var item = document.createElementNS("", "item");
item.appendChild(document.createTextNode(found[x]));
insertPoint.appendChild(item);
k=k+1;
}
} }
rafraichir(model,element)
}
}
...
the strange thing is that if i remove the alert("ouf") nothing work.
have you an idea about this pb.
Thanks
@all:sorry if i use english,you can responde in frensh i will understand.

Modifié par moez (05 Oct 2006 - 12:08)