Goodday,
I'm working on an Panel that has one function: downloading an excelsheet
that is a view to a database.
IN constructing the excel-sheet, I need a fromdate for a whereclause. There
are other clauses, but for simplicity's sake:
In a Wicket Form I have one DateTimeField fromDateTimePicker,
and one Link<String> downloadSpreadsheetButton:
fromDateTimePicker = new DateTimeField("vanafdatumtijd", new Model<Date>());
fromDateTimePicker.setOutputMarkupId(true);
fromDateTimePicker.setModelObject(new Date());
add(fromDateTimePicker);
downloadSpreadsheetButton = new Link<String>("download_spreadsheetbutton",
new Model<String>()) {
private static final long serialVersionUID =
9179702662683794429L;
@Override
public void onClick() {
Date picked = fromDateTimePicker.getModelObject();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy
HH:mm");
System.out.println(sdf.format(picked));
}
};
downloadSpreadsheetButton.setOutputMarkupId(true);
add(downloadSpreadsheetButton);
No matter what I try, I never get the entered date, always the initial date.
I suspect that the datetime-model isn't updated because there is no
form-submit (?).
Please help.
Regards, Hans
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/I-just-want-the-entered-value-of-a-WIcket-DateTimeField-tp3953280p3953280.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]