Creator Tip: Displaying two dimensional array in the table component

This tip explains how to display a two dimensional array of data in the Table Component. Creator comes bundled with dataproviders to display database table in the Table, along with other dataproviders like ObjectArrayDataProvider and ObjectListDataProvider to display data from POJOs (Plain Old Java Objects) using reflection. Unfortunately no dataprovider exists to display just a two dimensional array of data.

Read about how to create a two dimensional array data provider at


Hi Winston, I have retry your tutorial with netbean 5.5 and Tomcat 5.5.17 on Linux and Windows. All works fine within netbean, so the table shows the values from MyArrayDataProvider after binding. But during execution on Jboss + Tomcat, the table shows instead of values a few msg "no items found".

Posted by oblumert on March 25, 2007 at 08:01 AM PDT #

Hi! My problem is same: It works fine within Netbean. When I execution on Java System App. Server, the first row in the table shows "no items found".

Posted by Csanad on March 27, 2007 at 12:39 AM PDT #

you guys should initiate the myArrayDataProvider with the following code: myArrayDataProvider = new MyArrayDataProvider(); then it will have the data in run time. but it sounds to me that the number of collums is fixed to 3 in the jar file so that it will not show all data (collumn 4) of the following 2D array: String[][] data = { {"a1","a2","a3","x1"}, {"a4","a5","a6","x2"}, {"a7","a8","a9","x3"}, {"a10","a11","a12","x4"}, {"a13","a14","a15","x5"} };

Posted by barry on March 27, 2007 at 03:04 AM PDT #

hi Mr.Prakash, I just downloaded dataproviderex.jar from your url.After i open "the jar file should be corrupted" message should be displayed.Help me. Thanks, S.Vijay Ganesh.

Posted by VijayGanesh on April 27, 2007 at 02:50 PM PDT #

how do i convert the following code to populate / prerender a table component which is already draged and dropped into the page: (it worked very well in a normal servlet) out.println("No of matches="+hits.length()); out.println("<table><tr><th>Document</th><th>Score</th></tr>"); for (int i = 0; i < hits.length(); i++) { out.println("<tr><td>" + url + "</td><td>" + hits.score(i)+"</td></tr>"); } out.println("</table>");

Posted by Amit on May 30, 2007 at 12:03 PM PDT #

Hi Winston, This question may be slightly off-topic, but I beg your patience. I am dynamically creating a Table backed by an ObjectListDataProvider. The objectType of the provider is a bean object which contains a Vector of values. What I am trying to do is bind a column's value to the value of each element of the Vector. When I use the following binding, "#{currentRow.value['resultList']}" (where resultList is my Vector), the entire contents of the vector appear in the table cell; however, if I use the following binding to access the first element in the vector: "#{currentRow.value['resultList.0']}", I get the following exception: Exception Details: org.apache.jasper.JasperException java.lang.IllegalArgumentException: resultList.0 Is my syntax wrong? or is this type of binding just not supported? I am using NetBean 5.5.1 w/VWP installed. Any help would be greatly appreciated.

Posted by Mark on June 09, 2007 at 02:04 AM PDT #

i want yo learn how to create array of JButtons in JPanel

Posted by grajeshkanna on October 04, 2007 at 12:50 PM PDT #

i am trying to extend this data provider with the functionality to update the contents. so i've been looking at ObjectListDataProvider but i still didn't manage to make it work. how do i get the class to actually update stuff after the form has been submitted?

Posted by Johnny van de Laar on January 09, 2008 at 09:53 PM PST #

hi i am using netbeans-5.5 and servlets are not running in it. Even though packages are imported it shows packages cannot be imported.i have installed jdk1.5 and netbeans5.5.
do i need to install anyother softwares or set path.

Posted by saikiran on February 03, 2008 at 03:53 PM PST #

i need to learn how to work with Ajax components, please advise me to how to do that and let me know is there any Demos for that except currency provider and ajaxchatroom.

thank you

Posted by Dinesh on July 25, 2008 at 05:42 PM PDT #

how to create a progaram using 2 dimensional array with UML in java..pls response tnx

Posted by zarrah on January 07, 2009 at 11:56 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed

« April 2014