What if the source/ columns is dynamic generated? The normal source generated usually would be, for instance, 'List<Customer>'. So the column name mapping to the entity attribute can be rendered automatically by 'Contrib:Table' However, if the column name and table content are generated dynamically. What kind of format I need to put inside the source? This is my question.
My second question is - does the Contrib:Table can render aggregative cell inside a table? For instance, it looks like the html code <table> <!-- beg --> <tr> <td rowspan="4">date</td> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <!--- end --> </table> Stuff between 'beg' and 'end' would be treated as a set (like Customer in the List). Then repeatly rendering the set. How can I achieve it? The tapestry I use is 4.0.x. Java 1.6.x. Jboss 4.2.2 Mind Bridge wrote: > > Hi, > > Please use ExpressionTableColumn rather than > SimpleTableColumn in your code -- that will allow you > to extract the value you want in that column using > OGNL. SimpleTableColumn does not do that unless you > override it or set an evaluator. > > Also, what was wrong with the source/columns approach? > It should be perfect for the task... > > -mb > > --- Dar?o Vasconcelos <[EMAIL PROTECTED]> > wrote: > >> Hi, >> >> I'm trying to get a contrib:Table to accept as >> dataModel an ArrayList >> of HashMaps. This kind of ArrayList has been great >> inside Foreach >> components, since the hashmap's keys are easily >> referenced with ognl. >> Now I need the paging and sorting functionality, so >> the Table is the >> obvious choice. >> >> So far, all the cells in a row have the same display >> value (which is >> the toString() of the HashMap). I'm pretty sure I'm >> doing something >> wrong but can't figure out what it is. >> >> My .html: >> <table jwcid="@contrib:Table" >> tableModel="ognl:table" > >> >> My .java: >> public ITableModel getTable() { >> ... >> ... // some uninteresting details >> ... >> Set columns = ((HashMap)list.get(0)).keySet(); >> ITableColumn[] columnsList = new >> ITableColumn[columns.size()]; >> Iterator it = columns.iterator(); >> int i = 0; >> while (it.hasNext()) >> columnsList[i++] = new >> SimpleTableColumn((String)it.next()); >> >> return new SimpleTableModel(new >> SimpleListTableDataModel(list), >> new >> SimpleTableColumnModel(columnsList)); >> } >> >> The object named "list" is an ArrayList filled with >> HashMap objects. >> Each HashMap has the values of the cells associated >> to their column >> name, that's why I can get the column names from the >> first HashMap in >> the ArrayList. >> >> I know the ArrayList is not empty, and that the >> ITableColumn is >> correctly filled. Where is the error? >> >> Regards, >> >> Dario >> >> >> PS. BTW, I also tried using the source and columns >> parameters instead >> of the tableModel... >> -- >> Communism is man's exploitation of man. Capitalism >> is just the opposite. >> >> > --------------------------------------------------------------------- >> To unsubscribe, e-mail: >> [EMAIL PROTECTED] >> For additional commands, e-mail: >> [EMAIL PROTECTED] >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/contrib%3ATable%3A-using-a-List-with-Maps-as-dataModel-tp425441p14308529.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]