Have you tried the "indexed" property?

http://jakarta.apache.org/struts/userGuide/struts-html.html#select

Mark

-----Original Message-----
From: Rong Yu [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 06, 2003 12:02 PM
To: Struts Users Mailing List
Subject: Re: delete item(s) from <html:select>



Thanks, but how does struts work to assign a default value to a item? It
there any example for this? I can't find any good example on this.

Thanks,

-Rong


----- Original Message -----
From: "Mark Lowe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 06, 2003 11:05 AM
Subject: Re: delete item(s) from <html:select>


i think you need to pass some kinda value through because http doesn't pass
through blanks...

struts has a mechanism that helps deal with this where selects default to on
or off or something...

or you could just assign a temporary value when the item is selected for
deletion..

hope this is helpful mark


Gioved�, 6 feb 2003, alle 16:55 Europe/Rome, Rong Yu ha scritto:

> Hi,
>
> I have a  question as follow: how to delete one item from the select 
> component? Each time I try to click "Delete Selected" button, inside 
> QuestionSubjectDeleteAction class, subjectToDelete alway prints out as 
> empty. How to relate a selected item of <html:select> to 
> "deleteSubject" value in QuestionForm?
>
> Thanks
>
> -Rong
>
> I have the following code:
>
> ----------------------------------
> <html:form action="/subjdelete">
>
> <html:select property="deleteSubject" size="6" multiple="true" 
> onclick="true">
>    <logic:iterate id="test" name="questionForm" property="subject" 
> scope="session">
>         <html:option value=""><bean:write name="test"/></html:option>
>    </logic:iterate>
>
>   </html:select>
>
>   <html:submit property="delete" value="Delete Selected"/> 
> </html:form>
> -----------------------------------
>
> public final class QuestionForm extends ActionForm {
>
>   private String lastName;
>   private String question;
>
>   private String newSubject;
>   private String deleteSubject;
>   private String newType;
>
>   private List subject;
>   private List type;
>
>   .....
> }
> -------------------------------------------
> public final class QuestionSubjectDeleteAction extends Action{
>
>   public ActionForward perform(ActionMapping mapping,
>       ActionForm form,
>       HttpServletRequest request,
>       HttpServletResponse response) {
>
>     QuestionForm f = (QuestionForm) form; // get the form bean
>
>     String subjectToDelete = f.getDeleteSubject();
>     System.out.println("size of subject = " + f.getSubject().size());
>     System.out.println("subjectToDelete = " + subjectToDelete);
>
>   }
> }
>
> ----------------------------------------------------------------------
> -
> --------------------
>


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



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



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

Reply via email to