Use the x:columns tag inside the dataTable for dynamic amounts of columns; e.g:

<t:datatable value="#{rows}" var="row">
    <t:columns value="#{cols}" var="column">
        <f:facet name="header" value="#{column.name}"/>
        <h:outputText value="#{row.columnValue}"/>
    </t:columns>
</t:datatable>

regards,

Martin

On 8/16/05, Alin Dosoniu <[EMAIL PROTECTED]> wrote:
>  
> Hi, 
>   
> I am using t:dataTable on a page and need to change its number of columns
> when change value of a selectbox. Something like want to show 3 months and
> from a selectbox select value 6, so I want to display a table with 6 columns
> instead of 3. 
>   
> The problem that I have is that first time after modify the number of
> columns (now have january, february, march), I modify the columnHeaders list
> but in browser I get a table with only 3 columns as header (and the data
> from header is the old data - january, february, march) but with all 6
> columns for data. If I click on a link from scroller (go to second page for
> example), the page is showing the header correctly, it has 6 columns -
> january, february, march, april, may, june. 
>   
> Something similar is happening when changing the number of columns from 6 to
> 3. I get a table with 6 columns as header and only 3 columns as data. 
>   
> Do I have to call a specific method after changing the list of header
> values? Or is this a known problem of t:dataTable in this scenario? 
>   
> Thanks, 
> Alin. 


-- 

http://www.irian.at
Your JSF powerhouse - 
JSF Trainings in English and German

Reply via email to