value using JQuery
How I can get select component value using Jquery or javascript
MyJSF code below
you can pass the this
in this function:
onchange="onCall(this)"
and i am assuming you have defined this onCall
function in the global scope, then you can do this:
onCall(el){
alert(el.value);
}
As Primefaces provides a Javascript API for its components, you can access it through the widgetVar
xhtml
<p:selectOneMenu widgetVar="selectWV">
</p:selectOneMenu>
JS
PF('selectWV').getSelectedValue();//gets the value
PF('selectWV').getSelectedLabel();//gets the label