Hi Daniel,

PrimeFaces has the dynamic columns features for <p:dataTable>  Maybe you
can have a look at that option to have a variable number of columns.

regards
Rudy
-- 
Rudy De Busscher
http://www.c4j.be

On 17 January 2012 09:52, Daniel Reznick <vedm...@gmail.com> wrote:

> Here the code snippet
>
> 'from time to time' : i mean that when user clicks some radio button i re
> render the <h:panelGroup id="expenses_table_wrapper"> that holds the table
> , even when i dont specify the column ids explicitly and let the JSF do
> that, i still get the same "duplicate id exception"
>
> <h:panelGroup id="expenses_table_wrapper">
>
>            <h:form prependId="false" id="expenses_form">
>
>                <p:dataTable id="expenses_table"
> value="#{expensesPage.expensesList}" var="expense"
>                    rendered="#{not empty expensesPage.expensesList}">
>
>                    <c:forEach items="#{expensesPage.unitsOfTime}"
> var="unitOfTime">
>                        <p:column
>
> id="expenses_table_device_column#{expensesPage.fixStatisticsDateDate(unitOfTime)}"
>
>                            sortBy="SomeValue">
>
>                            <f:facet name="header">
>                                <h:outputText value="#{unitOfTime}"/>
>                            </f:facet>
>
>                            <h:outputText value="SomeValue"/>
>
>                        </p:column>
>                    </c:forEach>
>
>                </p:dataTable>
>            </h:form>
>
>        </h:panelGroup>
>
> On Tue, Jan 17, 2012 at 10:31 AM, Milo van der Zee <m...@vanderzee.org
> >wrote:
>
> > Hello Daniel,
> >
> > some code snippets could be helpfull.
> > What do you mean by 'from time to time'? Doe you use an ajax library to
> > rerender the table or do you mean by complete page render?
> >
> > Do you need the id's on the columns? Can't you just let JSF assign id's?
> >
> > I know that c: tags work problamatic with the view tree because they are
> > not an element in that tree. Often using ui:repeat works better.
> >
> > I don't know what is changed between 2.0.8 and 2.0.11. Might be that
> > they now follow the specs better...
> >
> > MAG,
> > Milo van der Zee
> >
> >
> > On Tue, 2012-01-17 at 08:37 +0200, Daniel Reznick wrote:
> > > Hi
> > >
> > > Till now I was creating dynamic columns inside a dataTable using the
> > > c:forEach , I was assigning unique Ids to each column and from time to
> > time
> > > was re-creating the table with different columns with no problem at all
> > >
> > > I was using the myfaces-api-2.0.5, myfaces-bundle-2.0.5 and the
> > > myfaces-impl-2.0.5 jars , yesterday I switched to 2.0.11 , and the
> > > c:forEach started to throw me errors , "java.lang.IllegalStateException
> > > component with duplicate id"
> > > and the id that was displayed was the id of the first column, so I
> guess
> > > for some reason it tries to create the same columns again and again and
> > > still remembers the old columns,
> > >
> > > so after seeing this error I downgraded to 2.0.8 , and the error was
> > gone,
> > > so... Some thing went WRONG between 2.0.8 and 2.0.11,
> > >
> > > what could it be?
> > >
> > > How can I solve this issue , cause I need to use 2.0.11 version,
> > >
> > >
> > > Help will be very appreciated,
> > >
> > >
> > > Regards,
> > >
> > > Daniel.
> >
> >
> >
>

Reply via email to