I’m trying to save a hidden value to be used by jQuery..
The jsf code:
<h:datatable id="myTable" var="aRow>
<h:inputHidden value="#{aRow.someValue}" id="myTrID"/>
<h:column> ... </h:column>
<h:column> ... </h:column>
</h:datatable>
When looking at the rendered page source I can’t see any evidence of the <h:inputHidden>.
FYI, What I am trying to do is access this <h:inputHidden> with this jQuery code:
$(document).ready(function() {
$("#myTable tr").click(function(event){
var tr_value = $(this).children("input[name='myTrID']").val();
alert("Row Value = " + tr_value);
});
});
Try to put the hidden value inside one of your columns. Maybe the
h:inputHiddenis not allowed as a child ofh:dataTable.