Announcement Announcement Module
Collapse
No announcement yet.
[solved] binding nested model of list containing custom obj Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [solved] binding nested model of list containing custom obj

    Hi.. i have a problem about a nested model object which is a list containing a collection of a custom class..

    I also tried to read this thread:
    http://forum.springframework.org/showthread.php?t=9845
    but in that thread the example show only if the nested object is a custom class.. not a list/collection of a custom class

    I have a model object named: PendingWoCommand to be passed to jsp:

    Code:
    public class PendingWoCommand{
        private List branchList;
        private List techList;
        private List solutionList;
        private List pendingWoList; // --> collection of a custom class named pendingWoList
        private List statusList;
        private String currentDate;
        private String cabang;
        private String stat;
    
        // ... getter & setter
    }
    and the PendingWoList class is like this:

    Code:
    public class PendingWoList {
        private String rcpt_no;
        private String status;
        private String promise_dt;
        private String model;
        private String address3;
        private String solution;
        private String technician;
        private String remarks;
    
        // ... getter & setter
    }
    so far for populating the list object with a collection of PendingWoList and showing the contents in jsp is no problem..
    but what I want to ask is:
    in the PendingWoList class, theres a string named solution and technician which I want to show as a combo box .. and when I submitted the form I want to bind each of their values to the objects contained in the list in PendingWoCommand...
    my view in jsp is like this:

    Code:
    						<c:forEach var="wo" items="${pwc.pendingWoList}" varStatus="status">
    							<tr>
    								<td></td>
    								<td>${wo.rcpt_no}</td>
    								<td>${wo.status}</td>
    								<td>${wo.promise_dt}</td>
    								<td>${wo.model}</td>
    								<td>${wo.address3}</td>
    								<td>
    									<select name="solution"
    										onmouseover="window.status='Solutions';"
    										onmouseout="window.status='';">
    										<c:forEach var="sol" items="${pwc.solutionList}" varStatus="stat">
    											<option value="${sol.sol_cd}"
    												<c:if test="${wo.solution eq sol.sol_cd}">
    													selected="true"
    												</c:if>
    											>${sol.sol_name}</option>
    										</c:forEach>
    									</select>
    								</td>
    								<td>
    									<select name="technician"
    										onmouseover="window.status='Technicians';"
    										onmouseout="window.status='';">
    										<option value="-">-</option>
    										<c:forEach var="tec" items="${pwc.techList}" varStatus="stat">
    											<option value="${tec.user_id}"
    												<c:if test="${wo.technician eq tec.user_id}">
    													selected="true"
    												</c:if>
    											>${tec.user_nm}</option>
    										</c:forEach>	
    									</select>
    								</td>
    								<td>${wo.remarks}</td>
    							</tr>
    						</c:forEach>
    but i can't seem to find a way to bind each of the string in the combo box named solution and technician to each PendingWoList object contained in the list in PendingWoCommand.. is there a way to do this? using initBinder and custom editors? or I should do that manually in onSubmit? using getParameterValues?

    any help would be appreciated.. thanks..
    Last edited by Rod Johnson; Jan 18th, 2006, 11:36 AM.

  • #2
    Problem solved

    I'm sorry.. silly me.. didn't go deep enough through the sourceforge forum.. hope this didn't happen again.. :?

    just in case someone want to know how i solved this problem.. just read this thread:

    http://sourceforge.net/forum/message.php?msg_id=2633380

    Comment


    • #3
      I have the simmilar problem.Please let me know the solution

      Comment

      Working...
      X