myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <simon.kitch...@rhe.co.nz>
Subject Re: How to dynamically show different components for each row in a table
Date Tue, 31 Oct 2006 22:39:25 GMT
Hi Kevin,

kevin_zhai wrote:
> I have a  Table that has a column containing buttons for operations on each
> row. Each row may have different operations applicable to it, so the buttons
> for each row need to be determined dynamically based on the contents of row. 
>
> I have seen code to dynamically create buttons, but what I would like to
> know is how to do this on a per-row basis, so that row 1 would might have 1
> button, row 2 would have 3 buttons and so on. I would like to avoid the
> solution of creating all of the possible types of buttons and hiding the
> ones that do not apply to the current row.
>   

It is not possible to change the set of components per-row. Instead, you 
*must* define all the possible types of components present in a row, 
then use the rendered attribute to show/hide them based on what you want 
to display on a specific row.

See the javadoc for the UIData component for details:
  http://myfaces.apache.org/api/apidocs/index.html

Regards,

Simon


Mime
View raw message