IDEMPIERE-1513 Find Window : should hide simple search tab if there's no selection column define.

This commit is contained in:
Heng Sin Low 2013-11-08 10:23:01 +08:00
parent 5447f06c0f
commit e391acaf51
1 changed files with 30 additions and 9 deletions

View File

@ -269,6 +269,13 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
{
return false;
}
if (!winMain.getComponent().getTabpanel(0).isVisible())
{
winMain.getComponent().setSelectedIndex(1);
onAdvanceTabSelected();
}
return true;
}
@ -676,6 +683,12 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
addSelectionColumn (field);
}
if (m_sEditors.isEmpty()) {
Tabpanel tabPanel = winMain.getComponent().getTabpanel(0);
tabPanel.getLinkedTab().setVisible(false);
tabPanel.setVisible(false);
}
gridFieldList = null;
m_total = getNoOfRecords(null, false);
@ -1072,16 +1085,9 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
}
else if (event.getTarget() instanceof Tab) {
if (winMain.getComponent().getSelectedIndex() == 1) {
fQueryName.setReadonly(false);
btnSave.setDisabled(m_AD_Tab_ID <= 0);
historyCombo.setSelectedItem(null);
if (advancedPanel.getItems().size() == 0) {
createFields();
}
onAdvanceTabSelected();
} else {
fQueryName.setReadonly(true);
btnSave.setDisabled(true);
historyCombo.setDisabled(false);
onSimpleTabSelected();
}
}
} //
@ -1171,6 +1177,21 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
} // onEvent
private void onSimpleTabSelected() {
fQueryName.setReadonly(true);
btnSave.setDisabled(true);
historyCombo.setDisabled(false);
}
private void onAdvanceTabSelected() {
fQueryName.setReadonly(false);
btnSave.setDisabled(m_AD_Tab_ID <= 0);
historyCombo.setSelectedItem(null);
if (advancedPanel.getItems().size() == 0) {
createFields();
}
}
private void parseUserQuery(MUserQuery userQuery)
{
String code = userQuery.getCode();