ObjectListData Provider work around - Sample Project
Few Creator users left comments in my previous blog Work around for Object List Data Provider design time problem, stating that they tried the work around but it did not help. So I decided to write a sample test project.
You can download the ObjectListDataProviderTest.zip from here
The simplest way to use ObjectListDataProvider is to add ObjectListDataProvider from the palette and then set your java.util.ArrayList of objects using the property sheet. Unfortunately due to some bugs in Creator this doesn't work. That is why some work around is needed until the bug is fixed in the future release.
To test the downloaded ObjectListDataProvider test project, do the followingNote:The above steps are necessary because of some class loading problem in creator design time which will be fixed in future release.
Now the table should display some sample data I added.
This is how I added the object list data provider to the application
BTW, if you make any changes to the classes "Name" or "NameListDataProvider" you must compile close and reopen project.
Note: As it is pointed in the comment below, to make it work at runtime, add the following statement to the session bean init() method
nameListDataProvider = new NameListDataProvider();
Posted at 07:43AM Feb 21, 2006 | Permanent link to this entry
Posted by Joe Paladin on February 21, 2006 at 08:32 AM PST #
Posted by Jayaraj on February 21, 2006 at 09:58 AM PST #
Posted by Dan on March 02, 2006 at 03:21 PM PST #
Posted by Dan on March 02, 2006 at 03:35 PM PST #
Posted by Frederic Bergeron on March 02, 2006 at 05:30 PM PST #
Posted by Diva on March 10, 2006 at 10:31 AM PST #
BTW, there is also an important feedback on POJOs field mapping I'd like to submit you :
Not a big surprise that several objects (I may bind to a Table) use composition !
Unfortunately, these "sub-objects" just appear as a whole in the available fields :-(
It would be great if introspection of the "target" class was a bit recursive, then producing enumeration of compound fields like [address.street] for instance. It seems that this would fairly match with the current design as it's "quite" what is done for direct database column binding.
While navigating in the r/o source code from the IDE, I found an introspect() method in the ObjectFieldKeySupport class. I guess, it's where the things take place...
Nevertheless, maybe a workaround still exists by dealing with FieldKeys[] in the OLDP subclass ?
Posted by Eric Camps on March 28, 2006 at 08:28 AM PST #
Posted by sirkware on March 30, 2006 at 12:04 AM PST #
Posted by Iyenemi I Tyger on April 06, 2006 at 02:53 AM PDT #
Posted by jesus on April 26, 2006 at 12:12 AM PDT #
Posted by James on May 22, 2006 at 12:35 PM PDT #
Posted by Topher Eliot on June 12, 2006 at 11:13 AM PDT #
Posted by Zheng on June 23, 2006 at 04:42 PM PDT #
Posted by Gabriel Galvão on August 03, 2006 at 12:51 PM PDT #
Posted by Bhajan on August 19, 2006 at 10:09 PM PDT #
Posted by Daniel mopont on December 11, 2006 at 05:46 AM PST #
Posted by Winston Prakash on December 11, 2006 at 08:52 PM PST #
Posted by am mohan rao on January 06, 2007 at 11:21 PM PST #
Posted by sean downey on January 15, 2007 at 06:24 PM PST #
Posted by Kevin on March 16, 2007 at 11:08 AM PDT #
Posted by Kevin on March 19, 2007 at 07:37 AM PDT #
Posted by Winston Prakash on March 19, 2007 at 07:55 AM PDT #
Posted by walid on April 05, 2007 at 08:32 AM PDT #
Posted by 122.161.11.117 on June 27, 2007 at 05:19 AM PDT #
When a I follow the simple drop "sql table" inside the "design table", I get success, but with a List (better implementation to my case) is like the actions doesn't exist.
I'm trying by 4 days includes this without any clear explanation.
:-(
Posted by Frank on July 25, 2007 at 06:11 PM PDT #
I found the problem, was a init mistake. The dataprovider need to exist before the Phase that process the actions. So, the code was moved from prerender to init.
Sometimes I forgot the basic and important concepts.
See you.
Posted by Frank on July 26, 2007 at 09:57 AM PDT #
Posted by Vijay on August 06, 2007 at 03:50 AM PDT #
hi winston. thanks a lot for the code. but one thing how do i get data from the method that gives a list of objects that is given by another project for ex J2ee ejb project that uses jpa
Posted by surya chandra on October 25, 2007 at 07:21 AM PDT #
Hi Winston. Thank you for the working example which was really useful. I was wondering as to whether conceptually this code should be added to the session bean or application bean? I was also wondering whether it is possible to create a table at run-time with variable number of columns depending on what the query demands. Some queries require only 2 comlumns to be displayed while others may require 6 columns. Is this possible?
Posted by Ranjan on November 13, 2007 at 02:02 AM PST #
Rajan, that depends on how your data is accessed. If you want all the users to have the same set of data then place it in the Application bean, other wise at Session Bean for each user to get their own set of data.
I have two articles explaining how to create dynamic tables at http://www.winstonprakash.com/articles/articles.html
Posted by Winston Prakash on November 13, 2007 at 06:37 AM PST #
Hi, Winston. I'd like to know how to display search result in the table component. You have to put the search input then click search button. Can you tell me the concept to do that? thank you in advance.
Posted by wowerng on January 07, 2008 at 10:55 PM PST #
Hi winston.
I need a small help.
I need to use Maps instead of List for getting the data into a table form an excel sheet using jsf.I am using netbeans 6.0 ide.can u please help me.
Awaiting for your response.
Thanks in advance.
Posted by Anvesh on April 11, 2008 at 04:15 AM PDT #
I don't think there is proper documentation or tutorial to explain how to use maps. Probably you should extract out the values of the map as list or array and then show it the table.
Posted by Winston Prakash on April 11, 2008 at 07:41 AM PDT #
http://www.batteryfast.co.uk/sony/vgp-bp2ea.htm sony vgp-bp2ea battery,
http://www.batteryfast.co.uk/sony/pcg-gr100.htm sony pcg-gr100 battery,
http://www.batteryfast.co.uk/sony/pcg-gr150.htm sony pcg-gr150 battery,
Posted by laptop batteries on October 23, 2008 at 11:47 PM PDT #