Dr. Winston Prakash Ph.D. 

Personal Website

Work around for Object List Data Provider design time problem

Due to some design time source modeling and class loading problem, looks like Design Time support for Object Array and Object List Data Provider is broken in Creator 2. Here is a work around to solve this problem.

Assume you have a list of Search Data in an object called "SearchData", to display java.util.List of SearchData in a table using Object List Data provider do the following.

First create a Java Class called SearchDataProvider.

import com.sun.data.provider.impl.ObjectListDataProvider;

public class SearchDataProvider extends ObjectListDataProvider{
public SearchDataProvider () {
setList(<your java.util.list of data here>);
}
}

In the SessionBean1.java add a property of type SearchDataProvider (Right click on the SessionBean1.java and select add -> property in the project windows). This action will add the following code to the SessionBean1.java

  private SearchDataProvider  searchDataProvider = new SearchDataProvider ();

public SearchDataProvider getSearchDataProvider() {
return searchDataProvider;
}
public void setSearchDataProvider(SearchProvider searchDataProvider) {
this.searchDataProvider = searchDataProvider;
}

Now add table component to the designer and select "Table Layout" from the context menu. In the dialog select "SearchDataProvider" in the drop down menu. You should see all the properties of your "SearchData" class as column in the Table column. The data from your "SearchData" objects will be displayed in the table.