OK! I got to a point where I was able to retrieve the right values for my
checked boxes.

I did this and it worked.

<logic:iterate id="register" name="searchResults"
type="org.acaosa.registration.RegistrationTO">
<tr>
<td width="5%">
<!--<html:checkbox name="deleteForm" property="deleteList" value="true"
indexed="true"></html:checkbox>-->
<html:multibox property="deleteList">
        <bean:write name="register" property="memberId"/>
</html:multibox>
</td>
        </tr>
</logic:iterate>

But the problem is when I display back the same page after deletion to
display a confirmation message, I ran into the following exception

[9/27/04 18:20:09:709 EDT] 5469b9c7 WebGroup      E SRVE0026E: [Servlet
Error]-[Cannot find bean searchResults in any scope]:
javax.servlet.jsp.JspException: Cannot find bean searchResults in any scope
        at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:1038)
        at
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:275)
        at
org.apache.jsp._searchResults._jspService(_searchResults.java:322)

and I know why this is happening because searchResult in the iterate Tag is
lost in the request scope. To come around this problem, I added a List
attribute in my DeleteActionForm class and populated that with the
searchResults list in my SearchAction class.

DeleteForm deleteForm = new DeleteForm();
memberList = RegistrationDAO.searchRegistration(inputType, inputText);
request.setAttribute("searchResults", memberList);
                        
deleteForm.setMemberList(memberList);
request.setAttribute("deleteForm", deleteForm);

And changed the logic:iterate tag
<logic:iterate id="register" property="memberList"
type="org.acaosa.registration.RegistrationTO">

This time it didnot recognize memberList and gave me a NullPointerException.

Any suggestions?

Thanks






-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Monday, September 27, 2004 6:03 PM
To: Struts Users Mailing List
Subject: Re: CheckBoxes in <logic:ietrate> tag


From: "Shabada, Gnaneshwer" <[EMAIL PROTECTED]>
> I replaced the checkbox with multi box and in my action class when I
> retrieved values, I was getting as "$register.memberId" Strings rather
than
> the memberIds for those checked. Am I doing anything wrong?

Are you using a JSP 2.0 container, and do you have it configured so that
expressions are automatically evaluated?

If not, you'll need to use the "EL" Struts tags.

I have an example from my own project posted here:
http://www.wendysmoak.com/wiki/cgi-bin/wiki.pl?StrutsMultiBox

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

======================================================================== 
This email message is for the sole use of the intended recipient (s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to [EMAIL PROTECTED] 
Toys "R" Us, Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to