}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// Net sum
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.auftrag.nettoSumme")).suppressLabelForWarning();
final DivTextPanel netPanel = new DivTextPanel(fs.newChildId(), new Model<String>() {
@Override
public String getObject()
{
return CurrencyFormatter.format(data.getNettoSumme());
}
}, TextStyle.FORM_TEXT);
fs.add(netPanel);
ajaxUpdateComponents.add(netPanel.getLabel4Ajax());
fs.add(new DivTextPanel(fs.newChildId(), ", " + getString("fibu.auftrag.commissioned") + ": "));
final DivTextPanel orderedPanel = new DivTextPanel(fs.newChildId(), new Model<String>() {
@Override
public String getObject()
{
return CurrencyFormatter.format(data.getBeauftragtNettoSumme());
}
}, TextStyle.FORM_TEXT);
fs.add(orderedPanel);
ajaxUpdateComponents.add(orderedPanel.getLabel4Ajax());
}
gridBuilder.newGridPanel();
{
// Title
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.auftrag.titel"));
final MaxLengthTextField subject = new RequiredMaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<String>(data, "titel"));
subject.add(WicketUtils.setFocus());
fs.add(subject);
}
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, "referenz")));
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// DropDownChoice status
final FieldsetPanel fs = gridBuilder.newFieldset(getString("status"));
final LabelValueChoiceRenderer<AuftragsStatus> statusChoiceRenderer = new LabelValueChoiceRenderer<AuftragsStatus>(this,
AuftragsStatus.values());
final DropDownChoice<AuftragsStatus> statusChoice = new DropDownChoice<AuftragsStatus>(fs.getDropDownChoiceId(),
new PropertyModel<AuftragsStatus>(data, "auftragsStatus"), statusChoiceRenderer.getValues(), statusChoiceRenderer);
statusChoice.setNullValid(false).setRequired(true);
fs.add(statusChoice);
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// project
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.projekt")).suppressLabelForWarning();
projektSelectPanel = new NewProjektSelectPanel(fs.newChildId(), new PropertyModel<ProjektDO>(data, "projekt"), parentPage,
"projektId");
projektSelectPanel.getTextField().add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(final AjaxRequestTarget target)
{
if (getData().getKundeId() == null && StringUtils.isBlank(getData().getKundeText()) == true) {
getData().setKunde(projektSelectPanel.getModelObject().getKunde());
}
target.add(kundeSelectPanel.getTextField());
}
});
// ajaxUpdateComponents.add(projektSelectPanel.getTextField());
fs.add(projektSelectPanel);
projektSelectPanel.init();
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// customer
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.kunde")).suppressLabelForWarning();
kundeSelectPanel = new NewCustomerSelectPanel(fs.newChildId(), new PropertyModel<KundeDO>(data, "kunde"), new PropertyModel<String>(
data, "kundeText"), parentPage, "kundeId");
kundeSelectPanel.getTextField().setOutputMarkupId(true);
fs.add(kundeSelectPanel);
kundeSelectPanel.init();
fs.addHelpIcon(getString("fibu.auftrag.hint.kannVonProjektKundenAbweichen"));
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// date
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.auftrag.datum"));
final DatePanel angebotsDatumPanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "angebotsDatum"), DatePanelSettings
.get().withTargetType(java.sql.Date.class));
angebotsDatumPanel.setRequired(true);
fs.add(angebotsDatumPanel);
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// Bindungsfrist
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.auftrag.bindungsFrist"));
final DatePanel bindungsFristPanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "bindungsFrist"), DatePanelSettings
.get().withTargetType(java.sql.Date.class));
fs.add(bindungsFristPanel);
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// contact person
final FieldsetPanel fs = gridBuilder.newFieldset(getString("contactPerson"));
final UserSelectPanel contactPersonSelectPanel = new UserSelectPanel(fs.newChildId(), new PropertyModel<PFUserDO>(data,
"contactPerson"), parentPage, "contactPersonId");
contactPersonSelectPanel.setRequired(true);
fs.add(contactPersonSelectPanel);
contactPersonSelectPanel.init();
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// Beauftragungsdatum
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.auftrag.beauftragungsdatum"));
final DatePanel beauftragungsDatumPanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "beauftragungsDatum"),
DatePanelSettings.get().withTargetType(java.sql.Date.class));
fs.add(beauftragungsDatumPanel);
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// Period of performance
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.periodOfPerformance"));
fromDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "periodOfPerformanceBegin"), DatePanelSettings.get()
.withTargetType(java.sql.Date.class));
fs.add(fromDatePanel);
fs.add(new DivTextPanel(fs.newChildId(), "-"));
endDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "periodOfPerformanceEnd"), DatePanelSettings.get()
.withTargetType(java.sql.Date.class));
fs.add(endDatePanel);
}