Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Daniel Wilmes
Multiple selection get data into class
August 4, 2011 6:58 AM
Answer

Daniel Wilmes

Rank: Regular Member

Posts: 164

Join Date: May 23, 2011

Recent Posts

Hi there I am trying to get a value out of a multipleselect list box. Here is the code for the multiple selection list box. I can get the the value in my class using a actionRequest, code is also below:
 1            
 2            <aui:field-wrapper label="user-admins">
 3                <aui:select id="additionalEmails" name="additionalEmails" multiple="true">
 4                    <option value="emial1@abc.com">emial1@abc.com</option>
 5                    <option value="emial2@abc.com">emial2@abc.com</option>
 6                    <option value="emial3@abc.com">emial3@abc.com</option>
 7                </aui:select>
 8            </aui:field-wrapper>
 9            /*****Java Code******/
10             public class SubmitFeedBack extends MVCPortlet {
11            public void submitFeedBackForm(ActionRequest actionRequest, ActionResponse actionResponse) {
12            System.out.println("AdditionalEmail = " + ParamUtil.getString(actionRequest, "additionalEmails"));
13            }}


However, I can seem to get all of the values the user selects. Any help. Thanks.
Anonymous
RE: Multiple selection get data into class
August 4, 2011 7:09 AM
Answer

Anonymous

Hmm,

Seems like a similar issue i had with checkbox, but it that i didnt get the value i set, since it set 0 and 1 for everything

http://www.liferay.com/c/message_boards/find_message?messageId=9967040
Daniel Wilmes
RE: Multiple selection get data into class
August 4, 2011 7:18 AM
Answer

Daniel Wilmes

Rank: Regular Member

Posts: 164

Join Date: May 23, 2011

Recent Posts

Great that worked great. Thank you.
Ranen Das
RE: Multiple selection get data into class
September 20, 2012 1:44 PM
Answer

Ranen Das

Rank: Regular Member

Posts: 137

Join Date: April 6, 2011

Recent Posts

String[] additionalEmails = ParamUtil.getParameterValues(request, "additionalEmails");
if(additionalEmails !=null){
for(String email:additionalEmails){
System.out.println("email >>>> "+ email);
}
}



It should work now