MVC, nested each

asked 2013-06-30 13:26:33 +0800

eew2000 gravatar image eew2000

updated 2013-06-30 13:31:34 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

Hi guys,

I have a range of objects of a class containing a list of objects from another class. I am presenting the objects in a grid.

It works fine. But how can I put the objects from the list in a listbox?

//Here I get data from the database:

entryList = helper.getAllEntries(db_table, entity_className);
            for (Criteria item : entryList) {
                System.out.println("item: " + item.toString());

// here I put them into grid
ListModelList<Criteria> entryModel = new ListModelList<Criteria>(entryList);

<template name="model">
// here I begin to fill the row in the grid
                    <row value="${each}">
                        <textbox rows="1" value="${each.name}"
                            width="90px" />
// gere I need to present the items of the inner list
// via forEach I do get the entries of parent objects, but not of inner list :( 
                        <listbox mold="select" width="80px">
                            <!-- listitem label="${each.name}" forEach="test1, tes2, Test3, test4"/ -->
                            <!-- listitem label="${each}" forEach="$(each.critDriverList)"/ -->
                                label="${forEachStatus.previous.each.critDriverList.item}: ${each}"
                                forEach="${each.critDriverList}" />

Do you have an idea here?

delete flag offensive retag edit
Be the first one to reply this discussion!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2013-06-30 13:26:33 +0800

Seen: 19 times

Last updated: Jun 30 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More