Hi!

I'm having the same troubles getting the content of a htmldatatable
displayed.

My code looks like this:

public HtmlPanelTabbedPane getTabPane() {
        Application app = FacesContext.getCurrentInstance().getApplication();
        
        // tabbedpane
        HtmlPanelTabbedPane hptp = 
(HtmlPanelTabbedPane)app.createComponent(HtmlPanelTabbedPane.COMPONENT_TYPE);
                
      // tab 1
      UIPanel tab = 
(HtmlPanelTab)app.createComponent(HtmlPanelTab.COMPONENT_TYPE);
      tab.setId("panelTab0");
      tab.getAttributes().put("label", "Tab 1");                
      hptp.getChildren().add(tab);

        
      // datatable
      UIData hdt = 
(HtmlDataTable)app.createComponent(HtmlDataTable.COMPONENT_TYPE);
      hdt.setId("hdtId1");
      hdt.setVar("hdtVar1");
      tab.getChildren().add(hdt);

      // 10 cols
      for (int i=0;i<10;i++) {
        UIOutput header = 
(HtmlOutputText)app.createComponent(HtmlOutputText.COMPONENT_TYPE);
        header.setValue("Header ("+i+")");
                
        // column
          UIColumn col1 = 
(HtmlSimpleColumn)app.createComponent(HtmlSimpleColumn.COMPONENT_TYPE);
          col1.setHeader(header);
          hdt.getChildren().add(col1);
                
        // text
          UIOutput text1 = 
(HtmlOutputText)app.createComponent(HtmlOutputText.COMPONENT_TYPE);
          text1.setValue("Content ("+i+")");
          col1.getChildren().add(text1);
    }
    return hptp;                
}

The table-header is redered correctly - not the content.

What are we doing wrong?

Thanks,
Harry

-----Ursprüngliche Nachricht-----
Von: Onur Tokan [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 09. Dezember 2005 08:22
An: MyFaces Discussion
Betreff: Re: What is wrong with this code

Yes Volker,

It's exacly the way I wanna do. I want to display 100 rows, 10 columns
table with header on each column.

Supposed to see the following result.

------------------------------------------------------------------------
Column Header 1 # Column Header 2  ... 10 columns here
-----------------------------------------------------------------------------------
Column Row 1     #  Column Row 1




                100 rows here





-------------------------------------------------------------------------------------

What do you think the problem is about?

Regards,

Onur

On 12/8/05, Volker Weber <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Onur Tokan 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.
>
> It is mandatory to set the value of UIData to a List, Array, ResultSet
> or DataModel valueBinding, from this are the rows build.
>
> >
> > Best regards,
> >
> > Onur
>
> regards
>  Volker
> --
> Don't answer to From: address!
> Mail to this account are droped if not recieved via mailinglist.
> To contact me direct create the mail address by
> concatenating my forename to my senders domain.
>

Reply via email to