*
* @param materialAssignment
*/
@SuppressWarnings("unchecked")
public void showSplitMaterialAssignmentDlg(A materialAssignment) {
MessageboxDlg dialogSplitAssignment;
final String message = _("Do you want to split the material assignment {0}?",
getMaterial(materialAssignment).getCode());
Map args = new HashMap();
args.put("message", message);
args.put("title", _("Split new assignment"));
args.put("OK", Messagebox.OK);
args.put("CANCEL", Messagebox.CANCEL);
args.put("icon", Messagebox.QUESTION);
dialogSplitAssignment = (MessageboxDlg) Executions
.createComponents("/orders/_splitMaterialAssignmentDlg.zul",
self, args);
Decimalbox dbUnits = (Decimalbox) dialogSplitAssignment
.getFellowIfAny("dbUnits");
dbUnits.setValue(getUnits(materialAssignment));
try {
dialogSplitAssignment.doModal();
int status = dialogSplitAssignment.getResult();
if (Messagebox.OK == status) {
splitMaterialAssignment(materialAssignment, dbUnits.getValue());
}
} catch (SuspendNotAllowedException e) {
throw new RuntimeException(e);