}.suppressLabelForWarning();
fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
@Override
public String getObject()
{
final BusinessAssessment bwa = getBusinessAssessment();
return fs.getString("fibu.businessAssessment.overallPerformance")
+ ": "
+ CurrencyFormatter.format(bwa != null ? bwa.getOverallPerformanceRowAmount() : BigDecimal.ZERO)
+ WebConstants.HTML_TEXT_DIVIDER;
}
}, TextStyle.BLUE));
fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
@Override
public String getObject()
{
final BusinessAssessment bwa = getBusinessAssessment();
return fs.getString("fibu.businessAssessment.merchandisePurchase")
+ ": "
+ CurrencyFormatter.format(bwa != null ? bwa.getMerchandisePurchaseRowAmount() : BigDecimal.ZERO)
+ WebConstants.HTML_TEXT_DIVIDER;
}
}));
fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
@Override
public String getObject()
{
final BusinessAssessment bwa = getBusinessAssessment();
return fs.getString("fibu.businessAssessment.preliminaryResult")
+ ": "
+ CurrencyFormatter.format(bwa != null ? bwa.getPreliminaryResultRowAmount() : BigDecimal.ZERO);
}
}));
final RepeatingView repeater = new RepeatingView(FieldsetPanel.DESCRIPTION_SUFFIX_ID) {
/**
* @see org.apache.wicket.Component#isVisible()
*/
@Override
public boolean isVisible()
{
return getBusinessAssessment() != null;
}
};
fs.setDescriptionSuffix(repeater);
IconPanel icon = new IconPanel(repeater.newChildId(), IconType.PLUS_SIGN).setOnClick("javascript:showBusinessAssessment();");
icon.setMarkupId("showBusinessAssessment").setOutputMarkupId(true);
repeater.add(icon);
icon = new IconPanel(repeater.newChildId(), IconType.MINUS_SIGN).setOnClick("javascript:hideBusinessAssessment();").appendAttribute(
"style", "display: none;");
icon.setMarkupId("hideBusinessAssessment").setOutputMarkupId(true);
repeater.add(icon);
gridBuilder.newGridPanel();
final DivPanel businessAssessmentPanel = gridBuilder.getPanel();
businessAssessmentPanel.setMarkupId("businessAssessment");
businessAssessmentPanel.add(AttributeModifier.append("style", "display: none;"));
final FieldsetPanel fieldset = new FieldsetPanel(businessAssessmentPanel, "").suppressLabelForWarning();
final Label label = new Label(DivTextPanel.WICKET_ID, new Model<String>() {
/**
* @see org.apache.wicket.model.Model#getObject()
*/
@Override
public String getObject()
{
final BusinessAssessment businessAssessment = getBusinessAssessment();
if (businessAssessment == null) {
return "";
}
return businessAssessment.asHtml();
}
});
label.setEscapeModelStrings(false);
fieldset.add(new DivTextPanel(fieldset.newChildId(), label).setMarkupId("businessAssessment"));
}