selectManyCheckbox set unique ID
Hi everybody,
I have a problem for getting, a specific Checkbox in my page.
I explain me :
I create a list of 20-30 checkbox in my page by using <html:selectManyCheckbox/>
if I write a Id : <html:selectManyCheckbox id="foo"/>
In the generated code I get the attributename called "foo" but no attributeId
And I realy need a unique Id for all those checkbox. Is there a way to get it ?
Thx a lot
[464 byte] By [
xtof83a] at [2007-11-27 11:06:18]

# 2
Yes maybe...
So : when the user click on the checkbox : I run a Javascript who display a div containing a text message.
Also, a request is send to the server, for updating the DB. (use A4j:support)
When the request is done, I delete the message.
Actually this message is display on top of the screen.
But I want it on/near the checkbox I checked/unchecked.
That's it ;)
# 3
Which JSF version are you using? I just see the ID's here:
JSF<h:form id="form">
<h:selectManyCheckbox id="checkboxes" value="#{myBean.selectedItems}">
<f:selectItems value="#{myBean.selectItems}" />
</h:selectManyCheckbox>
</h:form>
which renders<form id="form" name="form" method="post" action="/TestWebApp/test.jsf" enctype="application/x-www-form-urlencoded">
<table id="form:checkboxes">
<tr>
<td><input name="form:checkboxes" id="form:checkboxes:0" value="value1" type="checkbox" /><label for="form:checkboxes:0"> label1</label></td>
<td><input name="form:checkboxes" id="form:checkboxes:1" value="value2" type="checkbox" /><label for="form:checkboxes:1"> label2</label></td>
<td><input name="form:checkboxes" id="form:checkboxes:2" value="value3" type="checkbox" /><label for="form:checkboxes:2"> label3</label></td>
</tr>
</table>
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id1:j_id2" />
<input type="hidden" name="form" value="form" />
</form>
# 4
Thats crazy, I do exacty the same but I don't have any Id displayed in the rendered code.
<html:selectManyCheckbox layout="pageDirection" id="races" value="#{settings.selectedRaces}"
onclick="fadeIn(this)" enabledClass="TextBlue" disabledClass="TextBlueDisabled">
<core:selectItems value="#{settings.allRaces}" />
<a4j:support event="onchange" action="#{settings.updateRaces}" reRender="races" oncomplete="fadeOut()"/>
</html:selectManyCheckbox>
and no Id generated....Rrrrr.
Myfaces version : 1.1.5