table with object array data provider

hi!

i use the studio creator table and want to fill it with an object array data provider!

i have an array and the getter:

public TanData[] getTanDataArray()

{

return tanDataArray;

}

i choosed this for the data provider and in table layout i choose the dataprovider, but when i run my application there are no datas found although the array isn't empty!

[522 byte] By [schaeflia] at [2007-11-27 5:01:17]
«« Ontologies
»» struts
# 1

I know nothing about the Sun Studio Creator components, but for the JSF h:dataTable you can just wrap an ordinary object array in an [url=http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/model/ArrayDataModel.html]ArrayDataModel[/url]. You can also try to just convert the ordinary array to a List using List list = Arrays.asList(object[]) and pass it through that table.

BalusCa at 2007-7-12 10:18:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
i tried it with this page http://blogs.sun.com/divas/category/Web+UI+Componentswhen i do it like they then it works, but if i use my own datas and array it do not...
schaeflia at 2007-7-12 10:18:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

maybe this is a problem:

i got my data from a database table and i store it in a vector.

in the example they have a class WeekBean and they fill their array with

WeekBean[] weeks = {

new WeekBean(1),

new WeekBean(2),

new WeekBean(3),

new WeekBean(4)

};

and i tried to do this:

private Vector<TanData> tanDataList = new Vector();

private TanData[] tanDataArray;

getTanDataList().copyInto(tanDataArray);

could it be that that isn't correct?

schaeflia at 2007-7-12 10:18:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

this works:

TanData[] tanDataArray = {

new TanData("1223", 33, 89),

new TanData("3333", 66, 102),

}

;

this does not work:

tanDataArray = new TanData[2];

tanDataArray[0] = new TanData("1223", 33, 89);

tanDataArray[1] = new TanData("3333", 66, 102);

schaeflia at 2007-7-12 10:18:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
i solved the problem:objectArrayDataProvider.setArray(tanDataArray);this line was missing now it works!
schaeflia at 2007-7-12 10:18:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...