You might give the dataList component a look.  The rowIndexVar will give you the current row (http://myfaces.apache.org/tomahawk/dataList.html).
 
    <t:dataList id="data1"
        styleClass="standardList"
        var="country"
        value="#{countryList.countries}"
        layout="simple"
        rowCountVar="rowCount"
        rowIndexVar="rowIndex">
        <h:outputText value="#{country.name}" />
        <h:outputText value=", " rendered="#{rowIndex + 1 < rowCount}" />
    </t:dataList>
 
Gary
-------------- Original message --------------
From: "Romanowski, Tim" <[EMAIL PROTECTED]>
Perhaps to point this in a useful direction: is it possible to get a value of the current row (such as "row.id") from the FacesContext in a bean?  For example:
 
<t:column>
  <f:facet name="header">
    <f:verbatim>MyValues</f:verbatim>
  </f:facet>
  <h:outputText value="${currentRow.currentRowValues}" />
</t:column>
 
Is it possible to access another value for the currentRow object, such as currentRow.ID, by calling the FacesContext in a backing bean? If so, what is the proper way to do this? 
 
 
 


From: Romanowski, Tim
Sent: Wednesday, April 19, 2006 9:57 AM
To: [email protected]
Subject: Constructing Datatable with Columns Having Foreign Key references

 

When constructing a myfaces (tomahawk) datatable, I have a couple columns that each contain foreign key references.  How do you guys handle the situation where a given row in a datable might have a column that itself has multiple rows?  In other words, row 1 of my datable has a column which itself contains several rows.  It doesn't seem like placing a child datatable within a parent datatable will necessarily solve anything, since I don't know what data goes in the current row until I know the value of a column in the current row. 

From reading looking through the archives and some other sites, it looks (is this true?) that there is no clean way to pass a parameter of the current row id back to a backing bean to do some processing for dynamically constructing the current row.    I've seen some suggestions on setting f:param and using that value, but setting an f:param to equal the current rowid in a datatable doesn't seem to work.  I've also seen another kludge that used a 'disabled' property to set a map value, but that was, well, a kludge (but perhaps the best way?). 

Again, how are you guys constructing complex tables?  Any help would be greatly appreciated!

_____________________________________

TR


Reply via email to