I use jsf and primefaces components and I want to set a value to an h:outputText throught jquery
I inspect the tag with chrome tool (the id is the same)
but the value doesn't be set to the element here is the jsf code :
<p:confirmDialog id="confirmDialog" message="Etes vous sur de vouloir supprimer ce Type #{typeMB.selectedType.libelle}"
header="confirmation de suppression" severity="alert" widgetVar="confirmation">
<h:outputText id="fortest" value="donc" />
<h:form>
<p:commandButton id="confirm" value="oui" update=":form:ourdatatable" oncomplete="confirmation.hide()" actionListener="#{typeMB.supprimer}" />
<p:commandButton id="decline" value="non" onclick="confirmation.hide()" type="button" />
</h:form>
</p:confirmDialog>
here is the html code for my h:outputText tag :
<span id="fortest">donc</span>
and here is the jquery script :
<script type="text/javascript">
$(function() {
$('#form\\:ourdatatable\\:0\\:alors').click(function() {
alert("I am here");
var classList =$('#form\\:ourdatatable\\:0\\:alors').attr('class').split(/\s+/);
$.each( classList, function(index, item){
if(index > 1){
alert("I am here here ");
$('#fortest').text('here here');
}
});
});
});
</script>
I tested .text() and val() and html() method but the value is not set
thank you in advance