SunQuest
 
           Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 1st, 2008, 10:14 PM
Pierre Javason Pierre Javason is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 1 Pierre Javason User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 13 sec
Reputation Power: 0
Spring bind and jsp

Hey Guys
How's things

This is my first project in the spring framework.
I've checked and read many things but still can't seem to find a solution(which i'm sure exists) to the below problem.

So i'm creating an online exam. I have a Class Question that has question Components and the jsp - exam.jsp

Class:Question with appropriate getter and setter methods
Code:
private List<Component> components;


Class:Component
Code:
private boolean candidateBelieving;


exam.jsp
Code:
<c:forEach items="${question.components}" var="component" varStatus="loopstatus">
<br>
<spring:bind path="components[${loopstatus.index}].candidateBelieving">
<input type="radio" name="radio"  value="true" <c:if test="${status.value == true}">checked</c:if>/>

</spring:bind>
<c:out value="${component}"/>
</c:forEach>


My problem lies in the jsp code, in that It doesn't bind and set candidateBelieving to true but it used to and here's how.

Previously after reading http://mattfleming.com/node/134 I set name="<cut value='${status.expression}'/>" or something similar(similar because in trying to replicate it I was unable to do so.) The radiobuttons where grouped and data was binding to the command Object(Question) which was good. Until i added in <c:if test="${status.value == true}">checked</c:if> which was setup in case the user clicks the back button provided. At that point each radio button was being treated as a seperate one.

My question is how do i set the property in the spring bind tag if the radio button is ticked, have the radiobuttons as one group and have a radiobutton ticked if it was previously saved?

Is it possible to do this without the spring bind tag?

http://opensource.atlassian.com/confluence/spring/display/DISC/Working+with+Checkboxes
Code:
<c:forEach items="${command.childArray}" var="child" varStatus="loopStatus">
     <spring:bind path="command.childArray[${loopStatus.index}].selected"> 
        <input type="hidden" name="_<c:out value="${status.expression}"/>">
        <input type="checkbox" name="<c:out value="${status.expression}"/>" value="true"
            <c:if test="${status.value}">checked</c:if>/>
     </spring:bind>
   </c:forEach>


This seems very similar but is still causing problems.

Please help

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Spring bind and jsp


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway