CCC
CCC

Reputation: 2761

Models in a Wicket FormComponentPanel

I've created a FormComponentPanel to represent the current time which consists of 3 drop downs for hour and minute and meridiem. The model object of the FormComponentPanel is a Date object and the model of each drop down represents the selected option, but I need to change the model object in my component according to the options chosen from the drop downs. How can I do that?

Note: I cannot use any other component at this point of the development... I just need to able to get accurate data from the model object.

Upvotes: 0

Views: 410

Answers (2)

Stijn Geukens
Stijn Geukens

Reputation: 15628

I would propose to use java.util.Calendar instead or even better: JodaTime

Upvotes: 1

Jacek Cz
Jacek Cz

Reputation: 1906

I think java.util.Date can be used via 2 ComponentPropertyModel objects, accessing getters/setters as properties "hours", "minutes". I have no simple idea for "meridiem" property, this need to be coded. Or use 24h.

Upvotes: 0

Related Questions