Ricardo,
If you are going to use the html:link tag, then you
need to have it trigger a call to a JavaScript
function that will submit the form for you. Otherwise,
jjust clicking the link will not submit the form.
Regards,
Richard
--- Ricardo Cortes <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I am having a problem getting the checked values
> from a multibox that is submitted to my action and I
> was hoping one of you could help me out. I followed
> Ted Husted's example of using a Multibox within an
> iteration but I have a feeling that my setup is a
> bit different and thus renders a different solution.
> I'm using a JSTL forEach loop to loop through a
> list of MessageInstance objects. I want the user to
> be able to check which MessageInstances should be
> deleted and the action to perform the deletion.
> Everything gets rendered ok but when the form is
> submitted, the String[] object in the form is empty.
> I should also note that everything works fine if I
> use an html:submit but when I try to use an
> html:link to do the submit I don't get any checked
> values in my String[] object. I've included some
> code snippets below. Any help would be awesome.
>
> Thanks!
> Ricardo
>
> JSP:
> ===
>
> Submit Link (inside ManageNotesForm):
> ====================================
>
> <jsp:useBean id="deleteNotesLink" class=
> "java.util.HashMap"/>
> <c:set target="${deleteNotesLink}"
> property="membername"
> value="${requestScope.membername}"/>
> <c:set target="${deleteNotesLink}"
> property="task" value="delete"/>
> <html:link action="/submitMain"
> name="deleteNotesLink">delete</html:link>
>
> forEach Loop (inside ManageNotesForm):
> =====================================
>
> <c:forEach
> items="${sessionScope.messageInstances}"
> var="aMessageInstance" varStatus="status">
> <html:multibox name="${formName}"
> property="selectedItems">
> <c:out value="${aMessageInstance.id}"/>
> </html:multibox>
> <c:out value="${aMessageInstance.id}"/>
> </c:forEach>
>
> ManageNotesForm Bean:
> ====================
>
> private String[] selectedItems = {};
>
> public String[] getSelectedItems() {
> return selectedItems;
> }
>
> public void setSelectedItems(String[]
> selectedItems) {
> this.selectedItems = selectedItems;
> }
>
>
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]