Anyone clue me in.... I know I am doing something wrong.... A form is
definitely wrapped around my table...
any code snippets would be appreciated. I know this is a common
requirement, I've tried everything. I am new to the JSF world and do not
have a good grip on this stuff.
Thanks.
A.McCall wrote:
>
> Hi,
>
> I am having problems with getting the value of my checkbox into my
> backingbean. I have a datatable and in that table I have a
> SelectBooleanCheckbox.
> Below is a snippet of my JSF code:
>
> <table cellspacing="0" cellpadding="0" border="0"style="width:700px">
> <tr>
> <td valign="top"><t:dataTable id="rs"
> value="#{expense.searchRecipientList}" var="se"
> rowClasses="module_row_dark, module_row_light" width="100%"
> binding="#{expense.searchData}" tbodyClass="siteScrollCssClass"
> cellpadding="5"cellspacing="0" styleClass="container_table" border="0"
> <t:column>
> <f:facet name="header">
> <t:panelGroup>
> <t:outputText value="">
> </t:outputText>
> </t:panelGroup>
> </f:facet>
> <t:selectBooleanCheckbox forceId="selectAdd" id="selectAdd"
> styleClass="site_checkbox" binding="#{expense.addItem}"
> value="#{se.addItem}" >
> </t:selectBooleanCheckbox>
> </t:column></t:dataTable>
>
>
> Snippet from my backing bean... this gets executed from an actionlister on
> a command button.
> private UISelectBoolean addItem; ( and appropriate setters and getters)
> private UIData searchData; ( and appropriate setters and getters)
> public boolean onCmdBtnAddSearchRecipient(ActionEvent ae) {
> this.searchScreenValue = "1";
> displaySearchScreen.setValue("1");
> displaySearchScreen.setSubmittedValue("1");
> TreeMap workRecipientList = new TreeMap();
>
> ArrayList selected = new ArrayList();
> int first = searchData.getFirst();
> int rows = searchData.getRows();
>
> for (int i = first; i < (first + rows); i++) {
> this.searchData.setRowIndex(i);
> if (this.addItem.isSelected()) {
> selected.add(this.searchData.getRowData());
> }
> }
> }
>
> The problem is I am getting no rows in searchData(UIdata) when there are
> definitely rows in my table.
>
> What am I doing wrong.. I am definitely missing something.
>
> Please help,
>
> Thanks!
>
>
--
View this message in context:
http://www.nabble.com/DataTable-and-SelectBooleanCheckbox.-tf2749067.html#a7678043
Sent from the MyFaces - Users mailing list archive at Nabble.com.