Change assignment function information from Label for Listbox in resource allocation pop-up
FEA: ItEr75S23FixAllocationModel
This commit is contained in:
parent
8af4932e5a
commit
fe17a21697
2 changed files with 20 additions and 10 deletions
|
|
@ -74,6 +74,8 @@ import org.zkoss.zul.Decimalbox;
|
|||
import org.zkoss.zul.Detail;
|
||||
import org.zkoss.zul.Grid;
|
||||
import org.zkoss.zul.Label;
|
||||
import org.zkoss.zul.Listbox;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.SimpleConstraint;
|
||||
import org.zkoss.zul.SimpleListModel;
|
||||
|
||||
|
|
@ -289,7 +291,7 @@ public abstract class AllocationRow {
|
|||
|
||||
private Grid derivedAllocationsGrid;
|
||||
|
||||
private Label assignmentFunctionLabel = new Label();
|
||||
private Listbox assignmentFunctionListbox;
|
||||
|
||||
public AllocationRow(CalculatedValue calculatedValue) {
|
||||
this.currentCalculatedValue = calculatedValue;
|
||||
|
|
@ -346,17 +348,25 @@ public abstract class AllocationRow {
|
|||
effortInput.setSclass("assigned-hours-input");
|
||||
effortInput.setConstraint(constraintForHoursInput());
|
||||
loadEffort();
|
||||
updateAssignmentFunctionLabel();
|
||||
|
||||
assignmentFunctionListbox = new Listbox();
|
||||
assignmentFunctionListbox.setMold("select");
|
||||
|
||||
updateAssignmentFunctionListbox();
|
||||
}
|
||||
|
||||
private void updateAssignmentFunctionLabel() {
|
||||
private void updateAssignmentFunctionListbox() {
|
||||
AssignmentFunction function = getAssignmentFunction();
|
||||
Listitem listitemFunctionName;
|
||||
if (function == null) {
|
||||
assignmentFunctionLabel.setValue(_(AssignmentFunctionName.FLAT
|
||||
.toString()));
|
||||
listitemFunctionName = new Listitem(
|
||||
_(AssignmentFunctionName.FLAT.toString()));
|
||||
} else {
|
||||
assignmentFunctionLabel.setValue(_(function.getName()));
|
||||
listitemFunctionName = new Listitem(_(function.getName()));
|
||||
}
|
||||
assignmentFunctionListbox.getChildren().clear();
|
||||
assignmentFunctionListbox.appendChild(listitemFunctionName);
|
||||
assignmentFunctionListbox.setSelectedItem(listitemFunctionName);
|
||||
}
|
||||
|
||||
public abstract ResourcesPerDayModification toResourcesPerDayModification(
|
||||
|
|
@ -480,7 +490,7 @@ public abstract class AllocationRow {
|
|||
}
|
||||
|
||||
public void loadAssignmentFunctionName() {
|
||||
updateAssignmentFunctionLabel();
|
||||
updateAssignmentFunctionListbox();
|
||||
}
|
||||
|
||||
protected EffortDuration getEffortFromInput() {
|
||||
|
|
@ -782,8 +792,8 @@ public abstract class AllocationRow {
|
|||
});
|
||||
}
|
||||
|
||||
public Label getAssignmentFunctionLabel() {
|
||||
return assignmentFunctionLabel;
|
||||
public Listbox getAssignmentFunctionListbox() {
|
||||
return assignmentFunctionListbox;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
data.getRealResourcesPerDay());
|
||||
realResourcesPerDay.setStyle("float: right; padding-right: 1em;");
|
||||
|
||||
append(row, data.getAssignmentFunctionLabel());
|
||||
append(row, data.getAssignmentFunctionListbox());
|
||||
|
||||
// On click delete button
|
||||
Button deleteButton = appendDeleteButton(row);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue