Hi Harald,

you don't set any content to your UIData component, so you can't expect
any content rendered.

Setting the var property without using it in the coulum content is
useless. But it makes no sense to have content without valuebindings
using the 'var'.

But to force your table to display content you can add the additions i
made inline and see what is rendered. (should show 10 equal rows, exept
the last column, btw.)

Harald Müller wrote:
> 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);

        List content = new ArrayList();
        for (int i = 0 ; i<10;i++) {
          content.add("row " + i);
        }
        hdt.setValue(content);

> 
>       // 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);
>     }



      // create column
      UIColumn column =
(UIColumn)app.createComponent(HtmlSimpleColumn.COMPONENT_TYPE);

      // create and add header
      UIOutput header =
(UIOutput)app.createComponent(HtmlOutputText.COMPONENT_TYPE);
      header.setValue("Last Column");
      column.setHeader(header);
                        
      // create and add content
      UIOutput text =
(UIOutput)app.createComponent(HtmlOutputText.COMPONENT_TYPE);   
      ValueBinding valueBinding = app.createValueBinding(#{hdtVar1})
      text.setValueBinding("value", valueBinding);
      column.getChildren().add(text);

      // add column
      hdt.getChildren().add(column);

>     return hptp;              
> }
> 
> The table-header is redered correctly - not the content.
> 
> What are we doing wrong?
> 
> Thanks,
> Harry
> 

@Onur: Hope this helps you also.

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