How to display ImageObjects from an ImageObjet[ ][ ] Array into table

Hello,

I do the same with strings and that works without problems.

The Code wich creates the table. All providers are correct and instanciatet.

private Table createTable() {

String monat = null;

//Create the Table Dynamically

Table table = new Table();

table.setId("table2");

switch(getSessionBean1().getSelectedMonth()){

case 1 :

monat = "Januar";

break;

case 2 :

monat = "Februar";

break;

case 3 :

monat = "M\344rz";

break;

case 4 :

monat = "April";

break;

case 5 :

monat = "Mai";

break;

case 6 :

monat = "Juni";

break;

case 7 :

monat = "Juli";

break;

case 8 :

monat = "August";

break;

case 9 :

monat = "September";

break;

case 10 :

monat = "Oktober";

break;

case 11 :

monat = "Novemer";

break;

case 12 :

monat = "Dezember";

break;

}

table.setTitle("Team Plan - " + monat + " " + getSessionBean1().getSelectedYear());

//table.setPaginateButton(true);

//table.setPaginationControls(true);

// Create the Table Row group dynamically

TableRowGroup rowGroup = new TableRowGroup();

rowGroup.setId("rowGroup1");

rowGroup.setSourceVar("currentRow");

if(getSessionBean1().getZaehler() == 28){

rowGroup.setValueBinding("sourceData", getApplication().createValueBinding("#{TableDisplay.tableItems28ListDataProvide r}"));

}

if(getSessionBean1().getZaehler() == 29){

rowGroup.setValueBinding("sourceData", getApplication().createValueBinding("#{TableDisplay.tableItems29ListDataProvide r}"));

}

if(getSessionBean1().getZaehler() == 30){

rowGroup.setValueBinding("sourceData", getApplication().createValueBinding("#{TableDisplay.tableItems30ListDataProvide r}"));

}

if(getSessionBean1().getZaehler() == 31){

rowGroup.setValueBinding("sourceData", getApplication().createValueBinding("#{TableDisplay.tableItems31ListDataProvide r}"));

}

rowGroup.setRows(getSessionBean1().getAnzahlUser());

// Add the table row group to the table as a child

table.getChildren().add(rowGroup);

Field f[] = null;

if(getSessionBean1().getZaehler() == 28) {

TableItems28 ti = (TableItems28)tableItems28ListDataProvider.getList().get(0);

f = ti.getClass().getDeclaredFields();

}

if(getSessionBean1().getZaehler() == 29) {

TableItems29 ti = (TableItems29)tableItems29ListDataProvider.getList().get(0);

f = ti.getClass().getDeclaredFields();

}

if(getSessionBean1().getZaehler() == 30) {

TableItems30 ti = (TableItems30)tableItems30ListDataProvider.getList().get(0);

f = ti.getClass().getDeclaredFields();

}

if(getSessionBean1().getZaehler() == 31) {

TableItems31 ti = (TableItems31)tableItems31ListDataProvider.getList().get(0);

f = ti.getClass().getDeclaredFields();

}

for( int i = 0; i < f.length; i++) {

TableColumn tableColumn1 = new TableColumn();

tableColumn1.setId( "tableColumn"+String.valueOf(i) );

if (i == 0){

tableColumn1.setHeaderText( "Mitarbeiter" );

} else {

tableColumn1.setHeaderText( " "+String.valueOf(i) + "." + getSessionBean1().getSelectedMonth() + "." );

}

// Add the first table Column to the table row group

rowGroup.getChildren().add(tableColumn1);

// If activ, the provider Provides an ImageObject.It don`t work. Problem

// with value binding ?

ImageComponent image = new ImageComponent();

image.setValueBinding("imagecomponent", getApplication().createValueBinding("#{currentRow.value['"+f.getName()+"']}" ));

tableColumn1.getChildren().add(image);

//If activ, the provider provides a String Value. It works fine.

StaticText staticText1 = new StaticText();

staticText1.setValueBinding("text", getApplication().createValueBinding ("#{currentRow.value['"+f.getName()+"']}"));

// Add the static text to the table column1

tableColumn1.getChildren().add(staticText1);

}

return table;

}

I Would be happy, if anybody can help me.

Regards

Stefan

[4323 byte] By [selm] at [2007-11-26 8:44:11]
# 1
I'm not sure what do you mean by "ImageObject"Please take a look at this blog and see if that help http://blogs.sun.com/sakthi/entry/how_to_upload_and_retrieve- Winston http://blogs.sun.com/winston
wjprakash at 2007-7-6 22:26:18 > top of Java-index,Development Tools,Java Tools...