I have to do this in my wicketApplication class in his init-method right? With 
this call: Application.get().getConverterLocator().getConverter(Date.class) I 
only get the actual converter for the date. How can I register a new 
PatternConverter in my application. There is nothing like this 
Application.get().getConverterLocator().setConverter(Date.class, new 
PatternDateConverter("dd.MM.yyyy HH:mm:ss",true))? 

Can anybody give me an example please?


Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport & Logistics
Hoyerswerdaer Str. 18
01099 Dresden 
tel.:   +49 (0) 351 / 8152 - 188
fax:    +49 (0) 351 / 8152 - 209
email:  [email protected]

-----Ursprüngliche Nachricht-----
Von: Sven Meier [mailto:[email protected]] 
Gesendet: Donnerstag, 18. Juli 2013 16:14
An: [email protected]
Betreff: Re: CSV-Export change Datepattern

CSVDataExporter uses the Application's converters:

    IConverter converter =
Application.get().getConverterLocator().getConverter(c);

So register a suitable converter in your application.

Alternatively create a new Jira issue to allow passing an IConverterLocator 
into CSVDataExporter.

Sven

On 07/18/2013 03:29 PM, [email protected] wrote:
> Hello,
>
> in my application I have a table which includes a column timestamp. I have 
> created this column with the help of a Panel which includes a DateLabel.
>
> columns.add(new PropertyColumn<ProtocolRecord, String>(new 
> ResourceModel("protocolRecord.eventTimestamp").wrapOnAssignment(getPage()),"eventTimestamp","eventTimestamp"){
>              @Override
>              public void populateItem(Item<ICellPopulator<ProtocolRecord>> 
> cellItem, String componentId, IModel<ProtocolRecord> model)
>              {
>                  cellItem.add(new DatePanel<ProtocolRecord>(componentId, 
> model,"eventTimestamp"));
>              }
> });
>
> Here is the declaration of the DateLabel:
>
> public class DatePanel<T> extends Panel {
>      public DatePanel(String id, final IModel<T> model, String column)
>      {
>          super(id, model);
>          DateLabel datelabel = new DateLabel("date",new 
> PropertyModel<Date>(model, column),new PatternDateConverter("dd.MM.yyyy 
> HH:mm:ss",true));
>          add(datelabel);
>      }
> }
>
> So the table shows the date like this 18.07.2013 15:23:53. Furthermore the 
> table has an Exporttoolbar for csv. When I click the link for exporting the 
> csv, it includes the timestamp like this 2013/07/18. This is wrong. I need 
> the full timestamp as it would be shown in the table. Could anybody help me 
> please?
>
> Mit freundlichen Grüßen
> Christoph Manig
> email:  [email protected]
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to