Re: html:multibox question

2005-05-25 Thread Wendy Smoak
From: "Apte, Dhanashree (Noblestar)" <[EMAIL PROTECTED]>
>
> How do I make sure that only the selected ones get through?
>

http://struts.apache.org/userGuide/struts-html.html#multibox

WARNING: In order to correctly recognize cases where none of the associated
checkboxes are selected, the ActionForm bean associated with this form must
include a statement setting the corresponding array to zero length in the
reset() method.

-- 
Wendy Smoak


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



RE: html:multibox question

2005-05-25 Thread meyawn
well, when you uncheck a checkbox, there is nothing passed to your form. so
your form doesnt know which checkboxes are there on your page that are
unchecked. it knows only about the boxes you checked. so i guess you have to
reset your form after it has inited?? not very sure

-Original Message-
From: Apte, Dhanashree (Noblestar) [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 26, 2005 12:21 AM
To: 'Struts Users Mailing List'
Subject: html:multibox question



I have a page that has a series of check-boxes that a user can
select/deselect at will. When the page loads up, some of the checkboxes are
already checked. The user can then either select new ones or deselect
existing ones. However, when I submit the page, the unselected ones are
still a part of my selectedItems[] array.

How do I make sure that only the selected ones get through?

Thanks a bunch,




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



html:multibox question

2005-05-25 Thread Apte, Dhanashree (Noblestar)

I have a page that has a series of check-boxes that a user can
select/deselect at will. When the page loads up, some of the checkboxes are
already checked. The user can then either select new ones or deselect
existing ones. However, when I submit the page, the unselected ones are
still a part of my selectedItems[] array.

How do I make sure that only the selected ones get through?

Thanks a bunch,




html:checkbox or html:multibox- question in implementation

2005-01-21 Thread Rosemary Philip
Hi,

I have a jsp which shows a drop down combobox, a text box and submit
cancel buttons.
the drop down combo box is a collection of objects. to be exact an
arraylist which is placed in session in the action class.

The object is a technique object which has the following attributes:
techCd : type String : primary key 
techDscr : type String : a description of the technique
actCd : type String : can be A indicating Active and D indicating Deleted

--Earlier only these where present




 
 







Earlier the value can be selected and updated. select an old technique
and enter the new description in the textbox.

But now I need to place a checkbox alongside the drop down combo box ,
so that the checkbox gets checked when the selection in the combobox
changes.

I read everything I could on how to implement this, and I think I need
to do this via html:multibox
--Now trying to implement checkboxes-



 








  



the above code gives me a 
[ServletException in:/tiles/modifytile.jsp] Cannot create iterator for
this collection'

I have the following code in my ModifyForm


code:


 private String techUsed;
private String[] selected;
public String[] getSelected() 
{   
return selected;
}   
public void setSelected(String[] newSelected) 
{   
selected = newSelected; 
}   
public String getTechUsed() 
{   
return techUsed;
}   
public void setTechUsed(String str)
 {  
this.techUsed = str;
} 



Could anyone give any suggestions/help on what am I doing wrong,
please? Is it possible to check/uncheck a checkbox/multibox based on
the selected value in the dropdown combo box?

I think it will be simpler to write them as a list using 
and place checkboxes along side for each as indicated in this article

http://www.onjava.com/pub/a/onjava/2003/07/30/jakartastruts.html?page=last

But when there are too many values , the page can be too long.

If I use a single select list , the display will be better and users
can easily navigate to a value , but we should only have a single
checkbox and the problem becomes similar to that I am facing now.

single select list code sample
http://javaboutique.internet.com/tutorials/strutsform/index-4.html

Please help out. my only other option is scriplets.   :(
Thanks,
Rosemary

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