Add ON_SELECT event to Listbox, reseting assignment function to flat
FEA: ItEr75S23FixAllocationModel
This commit is contained in:
parent
d02f09ffbd
commit
9acb2ff391
2 changed files with 18 additions and 1 deletions
|
|
@ -361,6 +361,7 @@ public abstract class AllocationRow {
|
|||
AssignmentFunction function = getAssignmentFunction();
|
||||
if (function != null) {
|
||||
Listitem listitem = new Listitem(_(function.getName()));
|
||||
listitem.setDisabled(true);
|
||||
assignmentFunctionListbox.appendChild(listitem);
|
||||
assignmentFunctionListbox.setSelectedItem(listitem);
|
||||
}
|
||||
|
|
@ -802,4 +803,10 @@ public abstract class AllocationRow {
|
|||
return assignmentFunctionListbox;
|
||||
}
|
||||
|
||||
public void resetAssignmentFunction() {
|
||||
if (temporal == null) {
|
||||
setTemporal(origin);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ import org.zkoss.zk.ui.Component;
|
|||
import org.zkoss.zk.ui.WrongValueException;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Checkbox;
|
||||
|
|
@ -70,6 +71,7 @@ import org.zkoss.zul.Div;
|
|||
import org.zkoss.zul.Grid;
|
||||
import org.zkoss.zul.Intbox;
|
||||
import org.zkoss.zul.Label;
|
||||
import org.zkoss.zul.Listbox;
|
||||
import org.zkoss.zul.Radio;
|
||||
import org.zkoss.zul.Radiogroup;
|
||||
import org.zkoss.zul.Row;
|
||||
|
|
@ -617,7 +619,15 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
data.getRealResourcesPerDay());
|
||||
realResourcesPerDay.setStyle("float: right; padding-right: 1em;");
|
||||
|
||||
append(row, data.getAssignmentFunctionListbox());
|
||||
Listbox assignmentFunctionListbox = data.getAssignmentFunctionListbox();
|
||||
append(row, assignmentFunctionListbox);
|
||||
assignmentFunctionListbox.addEventListener(Events.ON_SELECT,
|
||||
new EventListener() {
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
data.resetAssignmentFunction();
|
||||
}
|
||||
});
|
||||
|
||||
// On click delete button
|
||||
Button deleteButton = appendDeleteButton(row);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue