1832: Accounting Manager - On Storage Accounting filters values must not have the popup validation
https://support.d4science.org/issues/1832 Fixed popup validation on filters git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/accounting-manager@122417 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1363631eb9
commit
7330f7686b
|
@ -59,7 +59,6 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|||
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
||||
import com.sencha.gxt.widget.core.client.form.StringComboBox;
|
||||
import com.sencha.gxt.widget.core.client.form.validator.EmptyValidator;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||
import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||
|
@ -88,7 +87,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
private GridRowEditing<AccountingFilter> editing;
|
||||
private TextButton addButton;
|
||||
private int seq;
|
||||
|
||||
|
||||
public interface FilterKeyPropertiesCombo extends PropertyAccess<FilterKey> {
|
||||
|
||||
|
@ -99,8 +97,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* public interface FilterValuePropertiesCombo extends
|
||||
* PropertyAccess<FilterValue> {
|
||||
|
@ -239,26 +235,28 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
// Value
|
||||
/*
|
||||
FilterValuePropertiesCombo filterValuePropertiesCombo = GWT
|
||||
.create(FilterValuePropertiesCombo.class);
|
||||
*/
|
||||
storeComboFilterValue = new ListStore<String>(new ModelKeyProvider<String>() {
|
||||
* FilterValuePropertiesCombo filterValuePropertiesCombo = GWT
|
||||
* .create(FilterValuePropertiesCombo.class);
|
||||
*/
|
||||
storeComboFilterValue = new ListStore<String>(
|
||||
new ModelKeyProvider<String>() {
|
||||
|
||||
@Override
|
||||
public String getKey(String item) {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public String getKey(String item) {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
|
||||
comboFilterValue = new StringComboBox();
|
||||
comboFilterValue.setStore(storeComboFilterValue);
|
||||
comboFilterValue.setClearValueOnParseError(false);
|
||||
comboFilterValue.setEditable(true);
|
||||
comboFilterValue.setForceSelection(false);
|
||||
|
||||
// comboFilterValue.setAllowBlank(false);
|
||||
|
||||
// comboFilterValue.setFinishEditOnEnter(false);
|
||||
// comboFilterValue.setAutoValidate(true);
|
||||
comboFilterValue.addValidator(new EmptyValidator<String>());
|
||||
// comboFilterValue.addValidator(new EmptyValidator<String>());
|
||||
comboFilterValue.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
// final TextField valueField = new TextField();
|
||||
|
@ -329,6 +327,10 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
@Override
|
||||
public void onCompleteEdit(CompleteEditEvent<AccountingFilter> event) {
|
||||
try {
|
||||
// GridCell cell = event.getEditCell();
|
||||
// int rowIndex = cell.getRow();
|
||||
// AccountingFilter editingFilter = store.get(rowIndex);
|
||||
|
||||
if (addStatus) {
|
||||
addStatus = false;
|
||||
}
|
||||
|
@ -440,7 +442,20 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
if (store == null || store.size() <= 0) {
|
||||
return null;
|
||||
} else {
|
||||
return new ArrayList<AccountingFilter>(store.getAll());
|
||||
List<AccountingFilter> filtersActives = store.getAll();
|
||||
ArrayList<AccountingFilter> filtersReady = new ArrayList<AccountingFilter>();
|
||||
for (AccountingFilter filter : filtersActives) {
|
||||
if (filter.getFilterValue() != null
|
||||
&& !filter.getFilterValue().isEmpty()) {
|
||||
filtersReady.add(filter);
|
||||
}
|
||||
}
|
||||
if (filtersReady.size() > 0) {
|
||||
return filtersReady;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
|
@ -495,7 +510,8 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
|
||||
private void retrieveFilterValuesByKey(FilterKey filterKey, final boolean cancelValue) {
|
||||
private void retrieveFilterValuesByKey(FilterKey filterKey,
|
||||
final boolean cancelValue) {
|
||||
FilterValuesRequest requestFilterValue = new FilterValuesRequest(
|
||||
filterKey, accountingStateData.getAccountingType());
|
||||
|
||||
|
@ -520,11 +536,11 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
@Override
|
||||
public void onSuccess(ArrayList<FilterValue> result) {
|
||||
Log.debug("FilterValues: " + result);
|
||||
ArrayList<String> values=new ArrayList<String>();
|
||||
for(FilterValue fv:result){
|
||||
ArrayList<String> values = new ArrayList<String>();
|
||||
for (FilterValue fv : result) {
|
||||
values.add(fv.getValue());
|
||||
}
|
||||
if(cancelValue){
|
||||
if (cancelValue) {
|
||||
comboFilterValue.clear();
|
||||
}
|
||||
storeComboFilterValue.clear();
|
||||
|
|
Loading…
Reference in New Issue