Currently I have a manual (valueMarkup=“true”) typeahead input field that when you click on a selection in the typeahead it enters whatever has not been enclosed in "informal’ tags.
Is it possible to get an event handle on when someone clicks on a TypeAhead entry so that some script can be executed?
A type-ahead has the same event triggers as the other controls.I’m not sure I understood your scenario, but it seems to me that the ‘onfocus’ event is what you want.
What I have is a universal style search bar at the top of all my Xpages. That allows you to search on a group of categories dictated by a combobox next to it, similar to Amazon’s search bar.
Your solution would be perfect if you can guarantee that the user would not start typing a search in then change their mind and go and click on something else. I cannot guarantee this so the onFocus (I think) on it’s own would not solve this.
I do have a solution now though and that is using the onChange client and server side javascript events.
On the Typeahed markup I have added a symbol (I am using the “>” symbol) to the start of the input that only appears when you select typeahead entry.
The Client side javascript checks to see if a special character is in the search. If this is detected then the serverside script is triggerred. If this symbol is not detected it is just a normal search and therefore does not require the onChange event to run.
This might not be the best solution but it works pretty well in the environment I have