You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Long <Br...@vt.edu> on 2006/07/06 16:26:20 UTC

checkbox value out of map

Hi folks,

I've got a Map that I'm using to render a list of checkboxes in the jsp,
thus:

---

  <logic:iterate id="group"
                   type="java.util.Map.Entry"
		   name="groupMemberViewerForm"
		   property="groups">
  
  <tr>
    <td class="field-data">
    <html:checkbox name="group" property="key" />
    </td>
    <td>
    <html:link action="/QueryManager"
          paramId="managedPersonUID"
	  paramName="group"
	  paramProperty="key">
	  <bean:write name="group" property="value"/>
    </html:link>
    </td>
  </tr>
  </logic:iterate>

---

When the form is submitted, where are the "checked" values?

Thanks in advance for any assistance.
-bml


-- 
Brian M. Long
Middleware Services, Virginia Tech
"Ancora Imparo (I am still learning)" - Michaelangelo, age 87



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: checkbox value out of map

Posted by Laurie Harper <la...@holoweb.net>.
Brian Long wrote:
> Hi folks,
> 
> I've got a Map that I'm using to render a list of checkboxes in the jsp,
> thus:
> 
> ---
> 
>   <logic:iterate id="group"
>                    type="java.util.Map.Entry"
> 		   name="groupMemberViewerForm"
> 		   property="groups">
>   
>   <tr>
>     <td class="field-data">
>     <html:checkbox name="group" property="key" />
>     </td>
>     <td>
>     <html:link action="/QueryManager"
>           paramId="managedPersonUID"
> 	  paramName="group"
> 	  paramProperty="key">
> 	  <bean:write name="group" property="value"/>
>     </html:link>
>     </td>
>   </tr>
>   </logic:iterate>
> 
> ---
> 
> When the form is submitted, where are the "checked" values?

You should end up with N request parameters named 'key' (one per checked 
box). If your form bean has a property named 'key', those request 
parameters should get set there (the property would need to be an array 
or list, to hold multiple values, of course).

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org