Have you looked at using <t:columns> for creating dynamic sets of
columns?   If nothing else, you can use this a reference code.

On 12/8/05, Onur Tokan <[EMAIL PROTECTED]> wrote:
> Thank you simon,
>
> I've already tried to set unique id. I think we are missing something.
> Maybe expert team members may show the way to do it. I've read all the
> forum postings before asking here. There is no exact answer about this
> topic. Maybe UIData component doesn't not support dynamic columns. Is
> it madatory to set DataModel attribute of UIData.
>
> Best regards,
>
> Onur
>
> On 12/8/05, Simon Kitching <[EMAIL PROTECTED]> wrote:
> > Onur Tokan wrote:
> > > I have a problem about creating dynamic HtmlDataTable component. The
> > > following code renders only the column's facets. NOT the CONTENTS...
> > > Thanks...
> > >
> > > HtmlDataTable dataTable = new HtmlDataTable();
> > > for (int i = 1; i <= 10 i++)
> > > {
> > >       UIColumn column = new UIColumn();
> > >       HtmlOutputText header = new HtmlOutputText();
> > >       header.setValue("Column Header"+i);
> > >       column.setHeader(header);
> > >       for (int j = 1; j <= 100 j++)
> > >       {
> > >               HtmlOutputText rowText = new HtmlOutputText();
> > >               rowText.setValue("Row:"+j+"Column:"+i);
> > >               column.getChildren().add(rowText);
> > >       }
> > >       dataTable.getChildren().add(column);
> > >
> > > }
> > > return dataTable;
> >
> > It looks ok to me.
> >
> > One things you should do is explicitly assign an id to each component
> > you create. All programmatically-created components should do this. And
> > of course you need to invent some id-generator code to ensure that the
> > assigned ids are all unique. However I doubt that this is the cause of
> > your problem...
> >
> > Regards,
> >
> > Simon
> >
>

Reply via email to