Christian Kaltepoth schrieb:
On Sunday 10 August 2008 21:22:05 Markus Mehrwald wrote:
Hello,

actually this is not really a MyFaces problem but hopefully someone can
help me although.
I have got a panel grid with two columns and a few rows. In this panel
grid I want to have something like a data table or a data list but not
as separate table in a column of the panel grid but only the rows i. e.
without a own <table> tag.
I tried to implement my own iterator which writes only <tr> and <td>
tags without the <table> tags because I have already <table> tags from
the panel grid. Unfortunately the panel grid always creates <table> tags
around my iterator.
Hopefully a small illustration will be helpfully for understanding what
I want:

Thank you for any kind of help!

There are several ways to achieve this:

* Use Tomahawks extended datatable with embedded="true". This prevents rendering of HTML table tags and just renders simple rows.
See: http://myfaces.apache.org/tomahawk/tlddoc/t/dataTable.html

* Use Tomahawks dataList component with layout="simple". This will simply render all children for each row, so you will have to render the <tr> and <td> tags yourself.

See: http://myfaces.apache.org/tomahawk/tlddoc/t/dataList.html

* If you are using facelets, you could also use <ui:repeat>

See: https://facelets.dev.java.net/nonav/docs/dev/docbook.html#template-repeat

I don't think any of this will work for the scenario Markus described.

AIUI, he has a panelGrid with two columns. He then wants to iterate over a single list, and put odd elements from the list into the left column of the panelGrid and even elements into the right column.

Markus, I think the only way to get the effect you want is to do explicitly what I described above: in the left column use a table or t:dataList to iterate over the list selecting only odd elements. Put same code in right column, but select even elements.

Or avoid using the panelGrid completely. You should be able to get a result that looks the same by using the appropriate html and css directly. Don't ask me how, though: I'm still trying to find time to learn CSS properly...

Regards,
Simon

Reply via email to