ItEr37S08CUCreacionUnidadesPlanificacionItEr36S11: Adding hours column
This commit is contained in:
parent
65aa0b1fdb
commit
0de6d986c3
3 changed files with 23 additions and 1 deletions
|
|
@ -75,6 +75,8 @@ class FormBinder {
|
|||
|
||||
private Map<AllocationDTO, Decimalbox> resourcesPerDayInputsByAllocationDTO = new HashMap<AllocationDTO, Decimalbox>();
|
||||
|
||||
private Map<AllocationDTO, Intbox> hoursIntboxesByAllocationDTO = new HashMap<AllocationDTO, Intbox>();
|
||||
|
||||
private EventListener onChangeEnableApply = new EventListener() {
|
||||
|
||||
@Override
|
||||
|
|
@ -245,6 +247,10 @@ class FormBinder {
|
|||
onChangeEnableApply(decimalbox);
|
||||
}
|
||||
|
||||
public void setHoursIntboxFor(AllocationDTO data, Intbox hours) {
|
||||
hoursIntboxesByAllocationDTO.put(data, hours);
|
||||
}
|
||||
|
||||
public int getAssignedHours() {
|
||||
Integer result = assignedHoursComponent.getValue();
|
||||
if (result == null) {
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
|
||||
// Label fields are fixed, can only be viewed
|
||||
appendLabel(item, data.getName());
|
||||
|
||||
bindHours(appendIntbox(item), data);
|
||||
bindResourcesPerDay(appendDecimalbox(item), data);
|
||||
// On click delete button
|
||||
Button deleteButton = appendDeleteButton(item);
|
||||
|
|
@ -550,6 +550,14 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
return decimalbox;
|
||||
}
|
||||
|
||||
private Intbox appendIntbox(Listitem item) {
|
||||
Intbox result = new Intbox();
|
||||
Listcell listcell = new Listcell();
|
||||
listcell.appendChild(result);
|
||||
item.appendChild(listcell);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void bindResourcesPerDay(final Decimalbox decimalbox,
|
||||
final AllocationDTO data) {
|
||||
decimalbox.setConstraint(new SimpleConstraint(
|
||||
|
|
@ -572,6 +580,12 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void bindHours(Intbox hoursIntbox, AllocationDTO data) {
|
||||
hoursIntbox.setDisabled(true);
|
||||
formBinder.setHoursIntboxFor(data, hoursIntbox);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ViewSwitcher getSwitcher() {
|
||||
|
|
|
|||
|
|
@ -154,6 +154,8 @@
|
|||
style="margin-bottom: 5px" fixedLayout="true" rows="4">
|
||||
<listhead>
|
||||
<listheader label="${i18n:_('Name')}" />
|
||||
<listheader
|
||||
label="${i18n:_('Hours')}" />
|
||||
<listheader
|
||||
label="${i18n:_('Resources Per Day')}" />
|
||||
<listheader />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue