And FYI, you should avoid using the request parameters yourself -- it
is best to let the JSF controls do that. DataTables not only use
client IDs, but also add an inded for each row, so it is really not
best to attempt to reproduce the ID yourself. Also renderers have the
full ability and right according to the specification to change the ID
to whatever they want (they don't even have to use the ID attribute
from the UIComponent if they don't want to)
On 8/9/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
If the checkbox is for a property on your loop variable (say Item):
<t:dataTable
value="#{mybean.mylist}"
var="_item">
<t:column>
<t:selectBooleanCheckbox value="#{_item.selected}" />
</t:column>
</t:dataTable>
If you want to save the checked items in a list on the bean:
<html
...
xmlns:jdt="http://www.jenia.org/jsf/dataTools">
...
<t:dataTable
value="#{mybean.mylist}"
var="_item">
<t:column>
<jdt:multipleRowsSelector
selectionList="#{mybean.selectedItems}" />
</t:column>
</t:dataTable>
Where "selectedItems" would map to methods:
public List<Item> getSelectedItems()
public void setSelectedItems(List<Item> items)
-Andrew
On 8/9/06, nimisha sharma <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I think this discussion must have already been there on this but since i
> could not find it, i m posting it here..
>
> I have a datatable where i have checkboxes in one column that the user
> checks.. these values have to be saved when the user clicks the save button.
> Somehow, i cannot get the values in my bean.. The command button for save
> has an action that calls the save() method in my bean. I have to get the
> values here so that i can update the db tables with these values.
>
> With each checkbox, i have set the param also.. as given:
>
>
>
> <t:selectBooleanCheckbox value="#{accountList.perfFee}" >
>
> <f:param id="selectedPerf"
>
> name="perf"
>
> value="#{accountList.perfFee}" />
>
> </t:selectBooleanCheckbox>
>
> now, in my bean if i try getting the value using:
>
> (String)
>
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("selectedPerf");
> it returns null as there would be a List of values..
>
> Could someone give me directions as to how this can be done...
>
> Appreciate,
>
>
> Nimisha.
>