I would like to know, how to make a connection between jsf/primefaces and javascript.
I want to call a listener in my backing bean after the user has typed a whitespace. To determine, which key was pressed, I got a javascript funktion
<script type="text/javascript">
function displayunicode(e){
var unicode=e.keyCode? e.keyCode : e.charCode
return unicode
}
</script>
If "space" was pressed the value of 'unicode' is 32.
Now I to call this function from a primefaces component with a 'onkeyup event'
<h:form>
...
<p:inputTextarea id="inputBeschreibung"
value="#{bean.value}"
rows="10"
cols="50"
queryDelay="300"
maxlength="500"
onkeyup="displayunicode(event); this.select()">
</p:inputTextarea>
...
</h:form>
I wan't to something like this in my primefaces komponent:
if(displayunicode(event); == 32) callBacking bean Method.
I have no idea how to do this.