1

User can select or deselect a record from a list of records in a table for update by checking and unchecking of a checkbox.

I am trying to maintain this check box value in a wrapper to identify weather it is checked or not, but due to some reason my code is not displaying the check box if I add it using the apex syntax so I am using an input tag like this:

<apex: repeat value="{!WrapperList}" var="rec">
  <input type="checkbox" id="chkbx"/> 
</apex:repeat>

instead of using the following code:

<apex: repeat value="{!WrapperList}" var="rec">
  <apex:inputCheckbox value={!rec.selected}" id="select"/>
</apex:repeat>

Here my question is how can I pass the checkbox values to the wrapper class list.

1
  • Please include the controller code as well. – Jagular Sep 18 '14 at 3:39
2

You can collect the values of checkboxes into a string using Javascript or similar, and then pass those back to the controller, but there's no reason why your second snippet of code shouldn't work. That would be the far easier way of doing things so your best bet is to debug that.

Check if the selected property in the wrapper is public and has a public setter, then if so, look at the source generated for the page to see if the checkbox is being hidden by some CSS voodoo or similar.

1

This worked with out using the input.

After placing my repeat tag into the outputpanel

Thanks for the reply.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.