ItEr37S08CUCreacionUnidadesPlanificacionItEr36S11: Disabling worker search tab
This commit is contained in:
parent
a599203bd6
commit
a66ff5cc31
3 changed files with 24 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ import org.zkoss.zul.Constraint;
|
|||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Intbox;
|
||||
import org.zkoss.zul.Listbox;
|
||||
import org.zkoss.zul.Tab;
|
||||
import org.zkoss.zul.impl.api.InputElement;
|
||||
|
||||
class FormBinder {
|
||||
|
|
@ -115,6 +116,10 @@ class FormBinder {
|
|||
}
|
||||
};
|
||||
|
||||
private boolean recommendedAllocation = false;
|
||||
|
||||
private Tab workerSearchTab;
|
||||
|
||||
public FormBinder(
|
||||
AllocationRowsHandler allocationRowsHandler,
|
||||
IResourceAllocationModel resourceAllocationModel) {
|
||||
|
|
@ -390,6 +395,9 @@ class FormBinder {
|
|||
|
||||
public void setCheckbox(Checkbox recommendedAllocation) {
|
||||
this.recommendedAllocationCheckbox = recommendedAllocation;
|
||||
this.recommendedAllocationCheckbox
|
||||
.setChecked(this.recommendedAllocation);
|
||||
disableIfNeededWorkerSearchTab();
|
||||
recommendedCheckboxListener = new EventListener() {
|
||||
|
||||
@Override
|
||||
|
|
@ -409,10 +417,22 @@ class FormBinder {
|
|||
private void activatingRecommendedAllocation() {
|
||||
allocationRowsHandler.removeAll();
|
||||
resourceAllocationModel.addDefaultAllocations();
|
||||
this.recommendedAllocation = true;
|
||||
disableIfNeededWorkerSearchTab();
|
||||
Util.reloadBindings(allocationsList);
|
||||
}
|
||||
|
||||
private void deactivatingRecommendedAllocation() {
|
||||
this.recommendedAllocation = false;
|
||||
disableIfNeededWorkerSearchTab();
|
||||
}
|
||||
|
||||
private void disableIfNeededWorkerSearchTab() {
|
||||
workerSearchTab.setDisabled(this.recommendedAllocation);
|
||||
}
|
||||
|
||||
public void setWorkerSearchTab(Tab workerSearchTab) {
|
||||
this.workerSearchTab = workerSearchTab;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
|
||||
private Tab tbResourceAllocation;
|
||||
|
||||
private Tab workerSearchTab;
|
||||
|
||||
public static void registerNeededScripts() {
|
||||
getScriptsRegister()
|
||||
.register(ScriptsRequiredByAdvancedAllocation.class);
|
||||
|
|
@ -187,6 +189,7 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
formBinder.setApplyButton(applyButton);
|
||||
formBinder.setAllocationsList(allocationsList);
|
||||
formBinder.setMessagesForUser(messagesForUser);
|
||||
formBinder.setWorkerSearchTab(workerSearchTab);
|
||||
formBinder.setCheckbox(recommendedAllocationCheckbox);
|
||||
CalculationTypeRadio calculationTypeRadio = CalculationTypeRadio
|
||||
.from(formBinder.getCalculatedValue());
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
<tabbox mold="accordion-lite">
|
||||
<tabs>
|
||||
<tab id="tbResourceAllocation" label="${i18n:_('Resource allocation')}" image="common/img/ico_bajar.png"/>
|
||||
<tab label="${i18n:_('Worker search')}" image="common/img/ico_bajar.png"/>
|
||||
<tab id="workerSearchTab" label="${i18n:_('Worker search')}" image="common/img/ico_bajar.png"/>
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<tabpanel>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue