Ok, this ought to be doable - and pretty simple, if one knows how to get a handle on the djFilteringSelect object.
Use case: I have taken over a request to extend an existing XPage with the functionality to drop down the list of values not only if the user clicks the small arrow to the right of the djFilteringSelect input field - but also if the user just clicks on the field. Most of the initial entries for this XPage are done in the manufacturing site (using touch screens - no mouse/keyboard). Subsequent processing is done by users using "normal" computers.
So I have tried to "catch" either "click", "mousedown" or "mouseup" events. I can do that - but I cannot get hold of the filteringselect that I know has a method "openDropDown()" that probably do what I need to do.... I have also tried to simulate a keypress event "arrowdown" as that also gives the same experience if I do it... And I even tried to delay the keypress event and add some context - but nothing is working.
So this is my current very simple example that is not working:
<xe:djFilteringSelect id="Antal" defaultValue="1">
<xp:selectItems id="selectItems13">
<xp:this.value><![CDATA[${javascript:var values=[];var i=0;while(i<=20){values.push(''+i++)};return values;}]]></xp:this.value>
</xp:selectItems>
<xp:selectItem itemLabel="20+"></xp:selectItem>
<xp:eventHandler event="onKeyUp" submit="false">
<xe:this.script><![CDATA[console.log("keyUp=" + thisEvent.keyCode)]]></xe:this.script>
</xp:eventHandler>
<xp:eventHandler event="onMouseDown" submit="false">
<xe:this.script><;
/// Hmmmm... not working
keyboardEvent.currentTarget = ct;
keyboardEvent.srcElement = se;
keyboardEvent.toElement = te;
console.log('Fire arrow down key...');
document.dispatchEvent(keyboardEvent);
},200);
]]></xe:this.script>
</xp:eventHandler></xe:djFilteringSelect>
So any ideas would be appreciated - especially by the users in the manufactoring site :-)
