Typically, I give a group of checkboxes the same input name and provide a different value for each one. Using standard HTTP and plain ol' Servlets, I can easily call ServletRequest.getParameterValues(String name) to get a String array of *all* the values. Then I can create a simple "for" loop that iterates through each element in the array, pulling out the desired values.
Using Keel of course, request.getParameter("MY_RID") will return a single value. No matter how many boxes are checked, only one will be returned.
I looked at the Poll application to see how Mike handles this. The comments in vote.jsp say that, "A multibox is a bit trickier than the other entry types, because it implies that there are multiple choices available for a single question." SubmitVote seems to do the following:
Prompt Model:This seems like a lot of extra work. Is there something I'm missing?
* Create and add the multivalued input to the response
Struts JSP:
* Use <struts:iterate> tag in the JSP to get each valid value
* Create a new, separate input for each and every choice by appending a unique string to the end of the input's name and assign it a value
Process Model:
* Get the value of each input with
oneKey.startsWith("CHOICE_"))
and then finally putting them all back together.
Thanks,
-BR
-- Brian Rosenthal [EMAIL PROTECTED] PlatinumSolutions, Inc. http://www.platinumsolutions.com 1610 Washington Plaza North Reston VA 20190 PH: 703.471.9793 FAX: 703.471.7140 |
