You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thamarajah Dharma <TD...@virtusa.com> on 2003/06/27 07:06:28 UTC
How to create checkboxe within an iterator tag.
Hi all.
I have a situation where i need to create checkboxes within an iterator
tag.
i tried creating it with a multibox inside the iterator tag but it throws
me this error
javax.servlet.jsp.JspException: You must specify the value attribute or
nested tag content
at
org.apache.struts.taglib.html.MultiboxTag.doEndTag(MultiboxTag.java:245)
how to overcome this problem...
thanx in
r
sasi
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: How to create checkboxe within an iterator tag.
Posted by "Prashanth.S" <su...@yahoo.com>.
Hi
kindly look at the dumps from my struts application which will definately usefull to u in fullfiling ur requirements.
<<<<Put this in ur jsp>>>
<%
String[] items = {"xyz","abc"};
request.setAttribute("items",items);
%>
<logic:iterate id="item" name="items">
<html:multibox property="selectedItems">
<bean:write name="item"/>
</html:multibox>
<bean:write name="item"/>
</logic:iterate>
<<put this in ur actionform>>
private String[] selectedItems = {};
public String[] getSelectedItems()
{
return this.selectedItems;
}
public void setSelectedItems(String[] selectedItems)
{
this.selectedItems = selectedItems;
}
public void reset(ActionMapping mapping, HttpServletRequest request)
{
String [] arrSelectedItems={};
this.setSelectedItems(arrSelectedItems);
}
<<<in ur action class u can crosscheck what u r getting from request>>>
String[] selectedItems = request.getParameterValues("selectedItems");
for(int i=0;i<(selectedItems.length);i++)
{
System.out.println("Index value-->"+i);
System.out.println("Logic-->"+ selectedItems[i]);
}
For further information u can take a look at the following url.
http://article.gmane.org/gmane.comp.jakarta.struts.user/52790/match=html+multibox+
Cheers
Prashanth
Thamarajah Dharma <TD...@virtusa.com> wrote:
Hi all.
I have a situation where i need to create checkboxes within an iterator
tag.
i tried creating it with a multibox inside the iterator tag but it throws
me this error
javax.servlet.jsp.JspException: You must specify the value attribute or
nested tag content
at
org.apache.struts.taglib.html.MultiboxTag.doEndTag(MultiboxTag.java:245)
how to overcome this problem...
thanx in
r
sasi
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!