myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Tasso <tas...@libero.it>
Subject adding a detail column to <t:dataTable>
Date Mon, 26 Dec 2005 10:42:16 GMT
Hi,
I'm starting using Tomahawk components and I find them very useful. My 
previuous experience dealt with Oracle ADF components, but they are full 
of bugs and not flexible.
But there's one feature of ADF table which is very nice.
Inside a datatable it is possible specifying a facet called 
"detailStamp". This is an example:

<af:table value="#{myManagedBean.allEmployees}"  
    var="emp">
	<f:facet name="detailStamp">
		<h:outputText value="#{emp.address}"/>
	</f:facet> 
	<h:column>
		<f:facet name="header">
			<h:outputText value="Name"/>
		</f:facet>
		<h:outputText value="#{emp.address}"/>
	</h:column>
</af:table>


The result is this: there's a column called "details" which contains a 
button, this button shows/hide the detail. Suppose that there are two 
rows. The initial state of the rendered table is this:

<table>
    <tr>
       <th>details</th>
       <th>Name</th>
    </tr>
    <tr>
          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
          <td>John Smith</td>
    </tr>
    <tr>
          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
          <td>Ed Ross</td>
    </tr>
</table>

When the user clicks  on the detail of the first row, a new row is 
displayed below the current row, so this is the result:

<table>
    <tr>
       <th>details</th>
       <th>Name</th>
    </tr>
    <tr>
          <td><a href="HIDE_DETAIL"><img src="hide.gif"/></a></td>
          <td>John Smith</td>
    </tr>
    <tr>
          <td colspan="2">Washington Avenue, Springfield, USA</td>
    </tr>
    <tr>
          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
          <td>Ed Ross</td>
    </tr>
</table>


The idea behind this component can be summurized as follows: every row 
in the table can be associated to a detail, which can be visibile or 
hidden according to the user action. When the user clicks on the show 
button, the content of the facet is displayed as a new ROW under the 
current row.

Now I'm wondering if something similar exists in Tomahawk or Sandbox.  
Pheraps, composing the existing components may produce the same result.
If  it doesn't exist, I suppose that implementing it could be very useful.
Please, tell me your opinions.


Mime
View raw message