This is my jsf table:
<h:dataTable value="myBean.rows" var="b">
<h:column>
<div class="slider-range-min">
<h:inputHidden id="buildingId" value="#{b.buildingId}" />
<h:inputHidden id="amount" value="#{b.amount}" />
</div>
</h:column>
</h:dataTable>
Now, lets say, I have in JavaScript access to above 'div' via jQuery:
$(this).
I can access first inputHidden
value this way: $(this).children[0].innerHTML
, but my goal is
to get this hiddenInput
field via id(buildingId)
, because order of these hiddenInputs
can change, so access through children[0]
could be no longer valid. How to achieve this?
(13:52:12 16.03.2013)
Hmm, no of your solutions does not work. This is my JavaScript code:
$(function() {
$( ".slider-range-min" ).slider({
range: "min",
value: 37,
min: 0,
max: 700,
stop: function( event, ui ) {
var buildingId = $(this).find('#buildingId').val();
console.log(buildingId);
As you can see, each div is a JQuery UI slider. Console prints 'undefined'. In html document one of these inputs in this table appears with id: "foodTableForm:foodTable:0:buildingId". So, as you can see, these id's are modyfied because of the table.