1

Using seam I have a list of users that I display in a table. I have a checkbox in the table for each user. I want to be able to check the box and have it perform an action. Right now the action is just to print to the screen but checking the box does nothing. What am I doing wrong?

The Page...

 <form id="myTableForm">
            <h:dataTable id="userList"
                         var="_myUser"
                         value="#{emailUser.emailList}"
                         rendered="#{not empty etemVwUsersList.resultList}">
                <h:column>
                    <f:facet name="header">Add</f:facet>


                        <h:selectBooleanCheckbox value="#{_myUser.getEmail}" id="ID-#{_myUser.id}">
                            <a:support event="onclick" actionListener="#{emailUser.selectUser}"
                                action="#{emailUserList.selectUser}"/>
                        </h:selectBooleanCheckbox>              
                </h:column>

UserList returns a list of emailUsers and has a method "selectUser" to look up the user to change

User is just an object with name, id, etc but is not tied to the database

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Jym
  • 21
  • 3
  • So it does work when instead of a `h:selectBooleanCheckbox` you use some other input component? – Kukeltje May 18 '17 at 05:58
  • What is the reason for choosing `id="ID-#{_myUser.id}"`? You can simply use fixed IDs in a data table. They will be prefixed with the row index. See http://stackoverflow.com/questions/8634156/how-to-find-out-client-id-of-component-for-ajax-update-render-cannot-find-compo – Jasper de Vries May 18 '17 at 07:23

0 Answers0