Grails - Multiple forms/Passing remote checkbox selections -


i have basic structure such:

<g:form>    actionsubmit </g:form>  <g:form>   actionsubmit </g:form>   <g:each in personlist - variable=person>    <tr>      <td><g:checkbox name="personlist" value="${person.id}" checked="${false}"/></td>      <td>          <g:form>             actionsubmit          </g:form>      </td>    </tr> </g:each> 

each of these forms relies on personlist checkbox array variable. prior edition of code wrapped entire div in form, worked caused problems when added third form in table.

how can pass selected checkboxes? have checkbox selects of boxes - need assign variable/hiddenfield array of selected boxes.

thanks!

edit

the issue having single form have column in each row has ability add elements 1 many relationship. if pass person.id corresponding action submit (so if hit actionsubmit on row 2, want pass person.id of row 2), piece of cake.

however, whenever tried tie person id, end array of person ids. figured way around have separate forms.

                            <td>                                 <div id="reportstoresultsdiv2_${person.id}" class="reportstoresultsdiv2_${person.id}">                                     <g:select id="reportsto" name="reportsto.id" from="${rtresults}" optionkey="id" value="" />                                     <g:actionsubmit action="addreportsto" value="add" params="[c_id:'${person.id}']"/>                                 </div>                             </td> 

i don't think checkbox supports both value , checked in way. perhaps want?

<g:each in="${personlist}" var="person>     <g:form controller="person" action="dosomething">         <g:hidden name="personid" value="${person.id}"/>         <g:checkbox name="superfly" checked="${person.superfly}"/>     </g:form> </g:each> 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -