[Bug #833] Disable advance search button

When doing recommended allocation it must be disabled.

FEA: ItEr69S04BugFixing
This commit is contained in:
Óscar González Fernández 2011-02-01 17:46:14 +01:00
parent 8848d7938f
commit 6aed9e08ff
3 changed files with 12 additions and 1 deletions

View file

@ -174,6 +174,8 @@ public class FormBinder {
private Decimalbox allResourcesPerDay;
private Button advancedSearchButton;
public FormBinder(Scenario currentScenario,
AllocationRowsHandler allocationRowsHandler,
IResourceAllocationModel resourceAllocationModel) {
@ -723,6 +725,7 @@ public class FormBinder {
private void disableIfNeededWorkerSearch() {
workerSearchTab.setDisabled(this.recommendedAllocation);
newAllocationSelectorCombo.setDisabled(this.recommendedAllocation);
advancedSearchButton.setDisabled(this.recommendedAllocation);
}
public void setWorkerSearchTab(Tab workerSearchTab) {
@ -730,6 +733,11 @@ public class FormBinder {
this.workerSearchTab.setDisabled(recommendedAllocation);
}
public void setAdvancedSearchButton(Button advancedSearchButton) {
this.advancedSearchButton = advancedSearchButton;
this.advancedSearchButton.setDisabled(recommendedAllocation);
}
public void setNewAllocationSelectorCombo(
NewAllocationSelectorCombo newAllocationSelectorCombo) {
this.newAllocationSelectorCombo = newAllocationSelectorCombo;

View file

@ -129,6 +129,8 @@ public class ResourceAllocationController extends GenericForwardComposer {
private Tab workerSearchTab;
private Button advancedSearchButton;
private Window editTaskWindow;
public static void registerNeededScripts() {
@ -217,6 +219,7 @@ public class ResourceAllocationController extends GenericForwardComposer {
initializeTaskInformationComponent();
initializeAllocationConfigurationComponent();
formBinder.setAdvancedSearchButton(advancedSearchButton);
CalculationTypeRadio calculationTypeRadio = CalculationTypeRadio
.from(formBinder.getCalculatedValue());

View file

@ -64,7 +64,7 @@
<hbox align="bottom" width="100%">
<newAllocationSelectorCombo id="newAllocationSelectorCombo" behaviour="NON_LIMITING"/>
<button label="${i18n:_('Add')}" onClick="allocationController.onSelectWorkers(newAllocationSelectorCombo)" />
<button label="${i18n:_('Advanced search')}" onClick="allocationController.goToAdvancedSearch()" />
<button id="advancedSearchButton" label="${i18n:_('Advanced search')}" onClick="allocationController.goToAdvancedSearch()" />
<checkbox id="extendedViewCheckbox" label="${i18n:_('Extended view')}"
onCheck="allocationController.onCheckExtendedView()"/>
</hbox>