Announcement Announcement Module
No announcement yet.
[solved] binding nested model of list containing custom obj Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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:
    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:

    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:

    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:

    						<c:forEach var="wo" items="${pwc.pendingWoList}" varStatus="status">
    									<select name="solution"
    										<c:forEach var="sol" items="${pwc.solutionList}" varStatus="stat">
    											<option value="${sol.sol_cd}"
    												<c:if test="${wo.solution eq sol.sol_cd}">
    									<select name="technician"
    										<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}">
    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, 10: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:


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