Using Multibox in Struts
By: Ivan Lim Printer Friendly Format
Multibox is a collection of checkbox. When a single checkbox
exists, it should be mapped to a Boolean. Such condition does not apply to collection
of checkboxes. Here we map it to a String array
checkboxes around the search display list as follows (Simplified
for clarity):
<html:form action="/manageCustomerList">
<c:if test='${not empty
CUSTOMER_SUMMARY_OBJECTS}'>
..
<html-el:multibox property="idSelections">
<c:out value='${customer.id}'/>
</html-el:multibox>
..
</c:if>
</html:form>
as follows.
public class ManageCustomersForm extends
ActionForm {
private String[] idSelections;
//getters and setters
public ManageCustomersForm() {
init();
}
protected void init() {
idSelections = new String[] { ""
};
}
..
}
ManageCustomersAction and ManageCustomersForm Build Deploy and See how the page displays at this point. This
should give you a clear picture of using multibox.
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Subscribe to Tutorials
Related Tutorials
Configuring JDBC DataSources in Struts
When is the best time to validate input in Struts
Simple example of using the requiredif Validator rule in Struts
How to prepopulate a form in Struts
Using JavaScript to submit a form in Struts
FAQ: Why are my checkboxes not being set from ON to OFF?
FAQ: Why was reload removed from Struts (since 1.1)?
What is a Plug-in and how to use Java plug-ins with Struts?
Origin and Architecture of Struts
Handling multiple buttons in HTML Form in Struts
Archived Comments
1. http://www.youtube.com/watch?v=tdtGe-6vuc8
View Tutorial By: Huge online casino wins - online casino 2 euro bet huge win - book of ra big win at 2017-05-27 05:41:38