Creator Tip: 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.
Posted at 10:03PM Feb 14, 2006 | Permanent link to this entry
Posted by Martin Schäfer on February 18, 2006 at 02:02 PM PST #
Posted by joe paladin on February 19, 2006 at 05:03 PM PST #
Posted by Joe Paladin on February 19, 2006 at 05:27 PM PST #
Posted by Kalki on April 09, 2006 at 10:36 PM PDT #
Posted by Ashokkumar on April 17, 2006 at 05:34 AM PDT #
Posted by James on May 22, 2006 at 12:32 PM PDT #
Posted by Sandeep on October 12, 2006 at 10:11 AM PDT #
Posted by vaxim on October 22, 2006 at 01:21 AM PDT #
Posted by 61.246.216.85 on January 03, 2007 at 09:55 PM PST #
Posted by andre on July 13, 2007 at 07:56 AM PDT #
Hi, Im making a table within a table. Meaning, 2 different table and 2 different objectlist provider.
My question how can i view my table with the following condition? Please help. thanks.
Posted by Christian Henry Reyes on August 20, 2007 at 11:36 PM PDT #
i tried clean and build project then close and reopen project, that worked.
Posted by wowerng on January 02, 2008 at 07:06 PM PST #
After struggling to get OLDP working...I got a real success!
Please let me know if some body is still struggling and I can provide Sun Creator Proof Of Concept project on OLDP!
Thank you
Abhay
abhaychitre@gmail.com
Posted by Abhay Chitre on March 12, 2008 at 11:37 AM PDT #
Hi Abhay, if you are using Netbeans 6.0 or later you don't need OLDP at all. You can directly bind List of Object to Table as I mentioned in my blog http://blogs.sun.com/winston/entry/nb6_table_binding_enhancement
Posted by Winston Prakash on March 12, 2008 at 12:30 PM PDT #
I am struggling with a related issue ... needing to display a list of entities I get back from an session ejb into a dropdown. The data binding on the the dropdown doesnt allow me to select the list (I have getters and setters for it). Do I need to use the OLDP route for this??
Im on nb6.1
Posted by Rambo on May 14, 2008 at 05:15 PM PDT #
Hi Prakash, I'm doing migration from NetBeans 5.5 to 6.1. Your workaround (clean, close IDE, reopen, delete private folder ecc... don't work!). If I build my project I don't see in the visual editor many components, expecially TableRows! There is a workaround for this problem?!?!? Thanks :-)
Chris
Posted by Chris on May 20, 2008 at 02:49 AM PDT #
Std OLDP doesnt work. Anyone know if this still an issue with NB6.1?
Posted by Rambo on May 20, 2008 at 08:19 PM PDT #
Hi Rambo, You don't have to use OLDP directly in NB 6.1. See my blog http://blogs.sun.com/winston/entry/nb6_table_binding_enhancement#comments
Posted by Winston Prakash on May 23, 2008 at 07:03 AM PDT #
http://www.batteryfast.co.uk/sony/pcga-bp3t.htm sony pcga-bp3t battery,
http://www.batteryfast.co.uk/sony/pcg-tr3.htm sony pcg-tr3 battery,
http://www.batteryfast.co.uk/sony/pcg-tr2.htm sony pcg-tr2 battery,
Posted by laptop batteries on October 23, 2008 at 11:52 PM PDT #