Announcement Announcement Module
Collapse
No announcement yet.
Binding a Hashset using JSP Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding a Hashset using JSP

    Hello,

    I have a Class "RiskIndicator" which has a property HashSet<BBT> bbts (BBT is a self written class).
    I use a SimpleFormController and a JSP form to visualize the Riskindicator as follows:
    Code:
    <form:form commandName="riskIndicatorType">
    Name: <form:input path="name" />
    
    	<c:forEach items="${bbts}" var="buildingBlock">
    
    		<c:out value="${buildingBlock.identityString}"></c:out>
    		<form:checkbox path="bbtypes" value="${buildingBlock.id}" />
    		<br />
    
    	</c:forEach>
    
    	<input type="submit" value="Weiter" name="_submit" />
    </form:form>
    The problem is, that I don't know, what I have to put in the value in the <form:checkbox/> element. I tried buildingBlock alone and buildingBlock.id but I get BindingErrors.
    In the form all available BBTs are shown (I put them in the referenceData method in a model to access them in the JSP). Now I want to connect the selected BBTs to my RiskIndicator object, but this doesn't work automatically. I could access the checked values by using the request.getParameterValues(), but is there a more beautiful method to manage this binding?

    thx for helping!
Working...
X