}
}
{
// Date
final FieldsetPanel fs = gridBuilder.newFieldset(getString("date"));
datePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "date"), DatePanelSettings.get().withTargetType(
java.sql.Date.class));
fs.add(datePanel);
}
{
// Title
final FieldsetPanel fs = gridBuilder.newFieldset(getString("title"));
fs.add(createAutocompleteTextField("title")).getField().setRequired(true).add(WicketUtils.setFocus());
}
{
// Contract type
final FieldsetPanel fs = gridBuilder.newFieldset(getString("legalAffaires.contract.type"));
final List<ContractType> contractTypes = ConfigXml.getInstance().getContractTypes();
final LabelValueChoiceRenderer<ContractType> typeChoiceRenderer = new LabelValueChoiceRenderer<ContractType>(contractTypes);
final DropDownChoice<ContractType> typeChoice = new DropDownChoice<ContractType>(fs.getDropDownChoiceId(),
new PropertyModel<ContractType>(data, "type"), typeChoiceRenderer.getValues(), typeChoiceRenderer);
typeChoice.setNullValid(false);
fs.add(typeChoice);
}
{
// Status
final FieldsetPanel fs = gridBuilder.newFieldset(getString("status"));
// DropDownChoice for convenient selection of time periods.
final LabelValueChoiceRenderer<String> statusChoiceRenderer = new LabelValueChoiceRenderer<String>();
for (final ContractStatus status : ContractStatus.values()) {
statusChoiceRenderer.addValue(status.name(), getString(status.getI18nKey()));
}
final DropDownChoice<String> statusChoice = new DropDownChoice<String>(fs.getDropDownChoiceId(), new PropertyModel<String>(data,
"status"), statusChoiceRenderer.getValues(), statusChoiceRenderer);
statusChoice.setNullValid(false);
fs.add(statusChoice);
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// Reference
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.common.reference"));
fs.add(new MaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<String>(data, "reference")));
}
{
// Resubmission date
final FieldsetPanel fs = gridBuilder.newFieldset(getString("resubmissionOnDate"));
resubmissionDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "resubmissionOnDate"), DatePanelSettings.get()
.withTargetType(java.sql.Date.class));
fs.add(resubmissionDatePanel);
}
{
// Due date
final FieldsetPanel fs = gridBuilder.newFieldset(getString("dueDate"));
dueDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "dueDate"), DatePanelSettings.get().withTargetType(
java.sql.Date.class));
fs.add(dueDatePanel);
}
{
// Signing date
final FieldsetPanel fs = gridBuilder.newFieldset(getString("legalAffaires.contract.signing"), getString("date"));
signingDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "signingDate"), DatePanelSettings.get()
.withTargetType(java.sql.Date.class));
fs.add(signingDatePanel);
}
{
// Validity
final FieldsetPanel fs = gridBuilder.newFieldset(getString("legalAffaires.contract.validity"));
validFromDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "validFrom"), DatePanelSettings.get()
.withTargetType(java.sql.Date.class));
fs.add(validFromDatePanel);
fs.add(new DivTextPanel(fs.newChildId(), "-"));
validUntilDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "validUntil"), DatePanelSettings.get()
.withTargetType(java.sql.Date.class));
fs.add(validUntilDatePanel);
}
gridBuilder.newSplitPanel(GridSize.COL50);
{