Using html:select with mutiple

hy, guys!I need some help:I am developing a form were I use a heml:select wich have to use the mutiple selecting function( the user could select more then one option)it looks like this:
<html:select property="sectors" multiple="true" size="3" ><html:option value="1">1</html:option><html:option value="2">2</html:option><html:option value="3">3</html:option></html:select>
but when I try to test on the action, getting from the form-bean and printing to test, for example:
SelectForm f=(SelectForm)form;
System.out.println(f.getSectors());
it only prints one of the selected options!!!that means it�s not getting all that is needed!!!what should I do?

It doesn't print out all the values because it returns an Array of String objects by default. You need to have getter/setter methods in your FormBean that return String arrays and take String arrays as argument respectively.
Hope that helps.
Regards
Hari

Similar Messages

  • Populate html:select with List of Strings

    Hello everyone,
    I need to populate an html:select with a List of Strings. The list I receive is not composed of objects, only Strings. I want each of these Strings to be an option of the select.
    I've tried this way:
                    <html:select property="tamanho" >
                       <html:options collection="gradeTamanho"/>
                    </html:select>Didn't work. Does anyone know how?
    thanks

    Does anyone know how to do this? There has to be someway that I can populate an Option List with a list of contentIDs in a folder. Maybe using CMIS?

  • How Can i use Html frames with  simple JSP???

    How Can i use Html frames with simple JSP???
    Actually i am creating an application in which i have used Index.html as frame.
    Noew i am trying that if i click on a link of one frame(say menu frame) the \result shoul come to some other frame(say frame named mainwindow).
    Hoe can i do like this???
    Anand Pritam

    Well i am using..
    < Base target="mainwindow">
    But it is no working is there some other way??

  • html:select with horizontal scroll bar

    I created list with fixed width, some records are long, I need a horizontal scrollbar to to view whole records. I use IE. How can I do this?
    Please help.
    piece of code..
                                                      <html:select property="pickedColSelect" style="width: 100%;"
                                                           multiple="true" size="10" ondblclick="examineColumnsPreRemove(myActionForm.pickedColSelect,false);
                                                                copyTextAndValueToSelectMenu(pickedColSelect, availColSelect, true, false,0, allowEdits);
                                                                     putFieldsInHidden(pickedColSelect, adHocReportForm.selectedColumnsString);
                                                                          return true;">
                                                           <html:optionsCollection name="adHocReportForm"
    Thanks in advance..

    See custom select tags in Coldtags suite:
    http://www.servletsuite.com/jsp.htm

  • How to use html:select

    hi,
    I have following html:select dropdown in my strut jsp.
    if the user selects on option from the dropdown, I want the user to click the "GO" button image, and send the selected value and a aparameter mode=8 from the dropdown to the Action class.
    then i can retrieve the option value(String) and the mode value and call my appropriate stored procedure.
    how can i achieve this.
    <bean:define id="countryList" name="locationForm" property="countryList" type="java.util.ArrayList"/> <html:select property="countryCountryGroupSelection"> <html:options collection="countryList" property="label" labelProperty="id" /> </html:select> <img src="../swa/i/go.gif" width="20" height="17"> </td>
    thanks,
    pp

    Hello,
    Create a hidden item and specify as source your select statement so the item contains the value you want.
    In your html region you specify the item like &P1_ITEM. and you should see the value.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/
    REWARDS: Please remember to mark helpful or correct posts on the forum

  • ERROR USING HTML textarea with Java String

    I have a form in HTML that has a textarea for input messages.
    When user press submit, a java servlet gets the information and stores it in a Database as a String.
    Later, I have a JSP thata retrieves that information from the database and put it as the value propertie of another textarea in the page so user can modify it if wanted, but I am having a hard time finding how to do so , because when I do the line:
    <textarea .....bla bla.... value=
    <%=some_string%>
    .....bla >
    and the some_string has more than one line ( e.g "\n" or "\r" caracteres ), I got an error when displaying the page. Can anyone help me with that please ???
    Thanks.

    here's my codes again for reference. hope it helps to rectify the matter
    // edit.jsp
    String search = (String)request.getParameter("txtSearch");
    String parameter = (String)"%"+search+"%";
    String sSQL = "select * from tblArticle where Title LIKE '"+parameter+"'";
    <%
    try {
    while(Rs.next()) {
    %>
    <tr>
    <td width="16%" height="157" align="center">Article:</td>
    <td width="88%" height="157"><textarea rows="15" name="txtArt" cols="86" value="<%= txtArt %>"></textarea></td>
    </tr>
    </table>
    <%
    // .....

  • Using JEditorPane.selected() with embedded tags.

    Ok, I've been searching the forums and tutorials for about an hour tonight, and I've seen this question asked in many forms but never answered.
    I am writing an applet which uses embedded HTML and some custom tags in a sub-class of JEditorPane that I wrote. I need to be able to get the position of certain tags within the text, which I can do using the JEditorPane.getText() method. But now that I've found the right tags, how can I highlight text contained within them in the visible Pane?
    e.g.:
    getText() returns
    <html>
    <head>
    </head>
    <body>
    Check</shu_ind> this <shu_dep>out</shu_dep>
    </body>
    </html>
    And these shu tags are the ones I want to use. I can parse the text and grab the right position, but when I select(begin,end), it's off by a lot b/c select() doesn't look at any embedded info.
    What can I do?

    I don't think it's the same as I'm doing. Essentially, I have a JEditorPane subclass, which just has a few custom tags in it. I don't need them to be recognized by java, since it will be uneditable, but I just need to know how to convert from the getText() locations to the actual displayed text locations.
    Also, when I set the text as text/html, it creates a bunch of extra HTML tags, so it's larger than the original String used to create it.

  • Using HTML text with an embedded font in Flex 4

    I have spent a day searching the interwebs and have not found a working example of how to use an embedded font with html formatting.
    Anybody know if it can even be done??

    Should be doable, but all fonts used in the html have to be embedded, and
    one of the fonts should be specified as the fontFamily for the component.

  • Can i use my ipod with mutiple itune

    can i do this

    YES
    Using iPod with multiple computers
    http://docs.info.apple.com/article.html?artnum=61675
    Managing content manually on iPod
    http://docs.info.apple.com/article.html?artnum=61148
    iPod: Frequently Asked Questions
    http://docs.info.apple.com/article.html?artnum=60920
    Patrick

  • Question about using VMware Fusion with mutiple user accounts on the mac

    I know this isn't a Fusion forum as such, but wondered if anyone knew the answer to this problem. I installed the latest version of fusion on my machine and a copy of windows XP. It's very good and am impressed with the ease and speed of it. However, I am the administrator and my 3 children have user accounts on the same computer. When my son logs in to his user account and starts up Fusion to do some homework on a windows only program, there isn't a virtual machine to start up. Does this mean that using fusion I can only use one mac user account? Or can I move the windows folder to a location for all to use, or is there a setting that I need to alter in Fusion? Perhaps I need to install windows again on his account. If so will this cause other potential problems and unnecessarily hog hard drive space. I would prefer fusion to boot camp because I need both windows and mac at the same time. Any help would be appreciated.

    Did you ask the VMware Community?
    My guess is yes, you need to put it in a Public folder or outside your account. XP doesn't take a lot of disk space, so maybe they should have their own (but then you need another copy/license).
    You may need to edit one of the prefs files pointing to the image, unless an alias or symbolic link will do.
    VirtualBox is free VM and is probably more than able to handle their needs.
    Probably need / want to create a new Windows user account while you are at it.

  • How to load data into html:select using Struts ?

    How to load data into <html:select> using Struts ?
    I can not load an array or collection (static or dynamic data) into drop down list control by <html:select /> Struts.
    please use:
    <html:select >
    <html:options />
    </html:select >
    Please help me. please detail it. thanks a lot.
    Message was edited by:
    tranminhman

    In order to load a collection or array of data you can use <html:select> with <html: options collection="" name=""/>
    here collection attribute refers to the Arraylist or Array of data and name is the name of the Form bean.
    Hope this helps...
    Chaitanya V

  • Help Implementing HTML OPTION with HTML

    Hi:
    I have a HTML page with the folowing code:
    </SELECT></TD>
    </TR>
    <TR>
    <TD width="156">Mode</TD>
    <TD width="86"></TD>
    <TD width="206"><SELECT name="mode">
    <OPTION value="regmode" selected>REG Mode</OPTION>
    <OPTION value="testmode">TEST Mode</OPTION>
    <OPTION value="devmode" selected>Dev Mode</OPTION>
    </SELECT></TD>
    I need help to implement the OPTION using JSP and JavaBean,
    For a simple text entry I am using the following code:
    <input size=20 type=text name=userID value=<jsp:getProperty name="_welcomeJSPBean" property="userID"/>>
    I am looking for a similar way to get all the posibles values for the HTML OPTION,
    Thank in Advance.
    Leonardo

    This is why many of the tag libraries and frameworks exist. I use Struts, and it has html taglib that includes tags for automating select/option to a very high degree.
    If the list is dynamic, you can use:
    <html:select property="commtypeno">
      <html:options collection="commtypeList" property="commtypeno" labelProperty="commtype" />
    </html:select>
    Or, if the list is static, you can use:
    <html:select property="commtypeno">
      <html:option value="1">Type 1</html:option>
      <html:option value="2">Type 2</html:option>
      <html:option value="3">Type 3</html:option>
    </html:select>
    Anthony

  • Html:select border issue.

    Hi,
    I am trying to put a border on a dropdownlist. For the dropdown, I am using html:select tag. I tried giving the border using the style attribute in html:select.(<html:select style="border:1px solid red"). It does not seem to be working. Could someone help me out and guide me in the proper direction. Thanks.

    Are we talking java here? Or is this javascript? If javascript, you know that this is a java forum, and that the two languages are vastly different. If you're asking about java, then sorry, but I'm at a loss to help you as I've never heard of these before.

  • HTML Panel with Tabs like Sliding Panel tabs

    Hi, what do I need to add/change to have HTML panels
    switching with tabs that switches background image like the tabs in
    sliding panels example?
    Or can I modify the
    sp_withTabs.js to have graphic tabs work with HTML
    Panels?

    Nevermind, I got it. I used the SpryTabbedPanels.js and
    modified the SpryTabbedPanels.css with my graphics, size, position
    and what not.
    I do have one more question. I'm using HTML Panels with Fade
    in and out and when loading my page I have to have default content
    in the main html doc for something to display when the page loads.
    Then when I click on the first button, it then loads the real
    external HTML panels. Is there any way I can load my first external
    HTML page right when my site loads?

  • Problem with html:select or html:options tags using struts,jsp and tomcat

    Hi
    I'm updating a Struts-Project to a new layout and therefore rework all jsp Sites.
    I'm also using a new Folder-Structure and update therefore my struts-config file.
    My Problem now is:
    Till now, we had a select-field with a code like this:
    < html:form action="/timetableAction" method="POST">
    < table width="53%" border="0">
    < tr>
    < td>< html:radio property="dauer" value="semester"
    /></ td>
    < html:select property="semester" size="1">
    < htmlptions name="semesterList" />
    </ html:select>
    </ html:form>
    The problem now is, that whenever I use any <html:xy> tag, the tomcat server I use can not show the page, he shows just the headers of the template, but not the
    content.-jsp-File where the form would be in. He stops right in the middle of the html page, when he notices the <html:xy> tags.
    And the funny thing is, that he has no problem to show a page when there is a <html:errors> within it? Why could this be? the struts-html.tld File is well included and teh Tomcat Server shows no exceptions.
    Waiting for you answers and thanks

    Thank you, I already got the answer in another forum

Maybe you are looking for