(Look like my previous post get lost)
Thank you Philippe
I am already loading my combo from a Server Side script, using a VIEW FT Search with this code.
var criteria = sessionScope.compToSearch;
var searchKey = "([Type] CONTAINS TECHNO AND [French] CONTAINS *"+criteria+"*)";
var currDoc:NotesDocument;
var myOpt=new Array();
if (null != criteria && criteria != "")
{
var currDb:NotesDatabase = session.getCurrentDatabase();
var currView:NotesView = currDb.getView("(keyWords)");
var viewElem = currView.FTSearch(searchKey);
if (viewElem >=1)
{
var loop = 0 ;
var categoryName = "" ;
for (i=1;i<=viewElem;i++)
{
currDoc = currView.getNthDocument(i);
if (null != currDoc)
{
//Si catégorie, charger les enfants
if( currDoc.getItemValueString("Type") == "TECHNO-CATEGORY")
{
var arr = @DbLookup(@DbName(), "(keyWords)", "TECHNO-" + currDoc.getItemValueString("code") , 3) ;
var len = arr.length;
for(var x=0 ; x<len ; x++)
{
myOpt[loop] = currDoc.getItemValueString("French") + "// " + arr[x] ;
loop += 1 ;
}
}
else
{
categoryName = @DbLookup("", "(keyWordsView)", "TECHNO-CATEGORY~" + currDoc.getItemValueString("parent"), 2) ;
myOpt[loop] = categoryName + "// " + currDoc.getItemValueString("French") + "|" + currDoc.getItemValueString("Code") ;
loop += 1 ;
}
}
}
myOpt.sort();
}
else
{
myOpt = "";
}
}
But I dont know what code to put on my OK button.
But I think it is just a classic mistake, as you suggest me to use getComponent.
<xp:button value="OK" id="buttonOK"
onclick="var comboSearch:javax.faces.component.UIComponent = getComponent('cbCompSearch');
var selection = comboSearch.getValue();
var comboProduct:javax.faces.component.UIComponent = getComponent('cbName');
if(selection != null)
{
comboProduct.setValue(selection) ;
}
XSP.closeDialog('#{id:dialogSearch}')"
style="width:28px">
</xp:button>
But I got the folling error
<span style="color:#f00;">missing ; before statement</span></div>
<span style="color:#f00;"><img class="errorBreak a11yFocus " role="checkbox" src="chrome://firebug/content/blank.gif" title="Stopper sur une erreur"/></span><a class="errorSource a11yFocus " title="<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">">var comboSearch:javax.faces.component....2:OneUIMainAreaCallback:dialogSearch')</a></div>
Thank you for any help or sample code.