Enlist a table's columns in other component

Posted by bungrudi on Stack Overflow See other posts from Stack Overflow or by bungrudi
Published on 2010-05-31T08:31:59Z Indexed on 2010/05/31 11:13 UTC
Read the original article Hit count: 213

Filed under:
|

The main goal is to have a dropdown menu where each of its menuItems represents one column of a <rich:extendedDataTable />.

Above the table I have this:

<rich:dropDownMenu value="Column visibility"
                        submitMode="none" direction="bottom-right">
        <c:forEach var="columnConfigVO" items="#{gridConfigurationManager.getColumnConfigs(listId)}">
               <rich:menuItem value="columnConfigVO.columnId" />
         </c:forEach>
</rich:dropDownMenu>

And then bellow that I have the usual <rich:extendedDataTable /> with its columns. I register the table columns to gridConfigurationManager component by overriding beforeRenderResponse() in ExtendedDataTable class.

The problem is that <c:forEach /> is executing before renderResponse phase, thus gridConfigurationManager.getColumnConfigs(listId) return empty.

The question is, how do I register the columns in gridConfigurationManager component before <c:forEach /> start executing?

Or, anyone know a different approach to accomplish this?

Thanks.

© Stack Overflow or respective owner

Related posts about jsf

Related posts about richfaces