Re: How to use CSVDataExporter

2014-11-06 Thread suvojit168
Francois Meillet wrote
 try
 Listlt;IExportableColumnlt;AffiliateModel, ?gt; columns = new
 ArrayListlt;IExportableColumnlt;AffiliateModel, ?gt;();

Hi François,

Thanks for reply. I am using wicket 6.16. As per this  Link
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/data/table/export/IExportableColumn.html
   
we have,

Interface IExportableColumnT,S,D

Type Parameters:
T - The type of each row in the table.
S - The type of the sort property of the table.
D - The type of the data displayed by this column.

When I try : 
ListIExportableColumnlt;AffiliateModel, ? columns = new
ArrayListIExportableColumnlt;AffiliateModel, ?(); 

I  get compile time error Incorrect number of arguments for type
IExportableColumnT,S,D; it cannot be parameterized with arguments
AffiliateModel, ?.

Nonetheless, this works :
ListIExportableColumnlt;AffiliateModel, ?, ? columns = new
ArrayListIExportableColumnlt;AffiliateModel, ?, ?();

I am getting a null pointer exception inside exportData (...) now which I am
looking at. Will add reply if I need assistance.

PS: It will be great if you can share some
examples/tutorials/articals/anything on CSVDataExporter ( I am not very much
comfortable with CSVDataExporter as of now).


Thanks,
Suvojit

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-use-CSVDataExporter-tp4668270p4668280.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to use CSVDataExporter

2014-11-06 Thread Francois Meillet
Hi Suvojit,

I don't know CSVDataExporter but I noticed that the second bounded type 
parameter was a 
wildcard and not a defined type.

I use Wicket 7 where there are only 2 parameters.

See some examples:
http://www.7thweb.net/wicket-jquery-ui/kendo/datatable/CommandsDataTablePage;jsessionid=2926A68F12DAE4CAC910C18699676209?0
https://doc.codelutin.com/cantharella/xref/nc/ird/cantharella/web/utils/data/TableExportToolbar.html


François


François Meillet
Formation Wicket - Développement Wicket





Le 6 nov. 2014 à 13:07, suvojit168 suvojit...@gmail.com a écrit :

 Francois Meillet wrote
 try
 Listlt;IExportableColumnlt;AffiliateModel, ?gt; columns = new
 ArrayListlt;IExportableColumnlt;AffiliateModel, ?gt;();
 
 Hi François,
 
 Thanks for reply. I am using wicket 6.16. As per this  Link
 http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/data/table/export/IExportableColumn.html

 we have,
 
 Interface IExportableColumnT,S,D
 
 Type Parameters:
 T - The type of each row in the table.
 S - The type of the sort property of the table.
 D - The type of the data displayed by this column.
 
 When I try : 
 ListIExportableColumnlt;AffiliateModel, ? columns = new
 ArrayListIExportableColumnlt;AffiliateModel, ?(); 
 
 I  get compile time error Incorrect number of arguments for type
 IExportableColumnT,S,D; it cannot be parameterized with arguments
 AffiliateModel, ?.
 
 Nonetheless, this works :
 ListIExportableColumnlt;AffiliateModel, ?, ? columns = new
 ArrayListIExportableColumnlt;AffiliateModel, ?, ?();
 
 I am getting a null pointer exception inside exportData (...) now which I am
 looking at. Will add reply if I need assistance.
 
 PS: It will be great if you can share some
 examples/tutorials/articals/anything on CSVDataExporter ( I am not very much
 comfortable with CSVDataExporter as of now).
 
 
 Thanks,
 Suvojit
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-use-CSVDataExporter-tp4668270p4668280.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 



Re: How to use CSVDataExporter

2014-11-06 Thread Sebastien
Hi François, Suvojit

Actually the Wicket Kendo UI's DataTable (first example) is using a custom
CSVDataExporter (largely inspired - not to say copy/paste - from the
original). But it can still itself be used for inspiration...

Source:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-kendo-ui/src/main/java/com/googlecode/wicket/kendo/ui/datatable/export/CSVDataExporter.java

Best regards,
Sebastien



On Thu, Nov 6, 2014 at 2:37 PM, Francois Meillet francois.meil...@gmail.com
 wrote:

 Hi Suvojit,

 I don't know CSVDataExporter but I noticed that the second bounded type
 parameter was a
 wildcard and not a defined type.

 I use Wicket 7 where there are only 2 parameters.

 See some examples:

 http://www.7thweb.net/wicket-jquery-ui/kendo/datatable/CommandsDataTablePage;jsessionid=2926A68F12DAE4CAC910C18699676209?0

 https://doc.codelutin.com/cantharella/xref/nc/ird/cantharella/web/utils/data/TableExportToolbar.html


 François


 François Meillet
 Formation Wicket - Développement Wicket



Re: How to use CSVDataExporter

2014-11-05 Thread Francois Meillet
We have IExportableColumnT, S
where T is the type of each row in the table.
where S is the type of the sort property of the table.
 
and the method 
public T void exportData(IDataProviderT dataProvider, 
ListIExportableColumnT, ? columns, OutputStream outputStream)

try
ListIExportableColumnAffiliateModel, ? columns = new 
ArrayListIExportableColumnAffiliateModel, ?();


François Meillet
Formation Wicket - Développement Wicket





Le 5 nov. 2014 à 15:47, suvojit168 suvojit...@gmail.com a écrit :

 Hi,
 
 I am trying to export data to csv in my wicket pages. I am using
 CSVDataExporter for this purpose. Due to some constraints I am not using it
 in conjunction to ExportToolbar. There is a link and on click of the link I
 am trying to call exportData() on instance of CSVDataExporter. 
 I am using AbstractExportableColumn for columns writing data to columns. 
 
 However I am getting a compile time error on exportData. Follwoing is the
 code (excelDataImport is the link here ):
 
 excelDataImport.add(new AjaxEventBehavior(onclick) {
   private static final long serialVersionUID = 1L;
 
   protected void onEvent(AjaxRequestTarget target) {
   ListIExportableColumnlt;AffiliateModel, 
 String, String columns = new
 ArrayListIExportableColumnlt;AffiliateModel, String, String();
   columns.add(new 
 AbstractExportableColumnAffiliateModel, String,
 String(new ModelString(Affiliate Name), name) {
 
   @Override
   public IModelString getDataModel(
   IModelAffiliateModel 
 arg0) {
   // TODO Auto-generated method 
 stub
   return null;
   }
   
   });
   
   try {
   new CSVDataExporter().exportData(new 
 AffiliateDataProvider(null),
 columns, new FileOutputStream(test.xls));
   } catch (FileNotFoundException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
   } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
   } catch (Exception e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
   }
 
   
   
 
   }
   });
 
 The error message is  : The method exportData(IDataProviderT,
 ListIExportableColumnlt;T,?,?, OutputStream) in the type CSVDataExporter
 is not applicable for the arguments (AffiliateDataProvider,
 ListIExportableColumnlt;AffiliateModel,String,String,
 FileOutputStream).
 
 I think I did it all correctly (as per whatever knowledge I could get on
 this subject), am I doing something wrong here?
 
 Also, can anyone share with me some sample examples and description/details
 for CSVDataExporter? I have gone through example in  DataTablePage.java in
 wicket example but that is using  DataTable and ExportToolbar. 
 
 Thanks,
 Suvojit
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-use-CSVDataExporter-tp4668270.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org