[ 1876544 ] Field group visible when fields are not
- Patch at revision 4356 not working.
This commit is contained in:
parent
9d5cab42ef
commit
5e4f59dea0
|
@ -975,48 +975,38 @@ public class GridController extends CPanel
|
||||||
} // all components
|
} // all components
|
||||||
|
|
||||||
// hide empty field group based on the environment
|
// hide empty field group based on the environment
|
||||||
Map<String, CollapsiblePanel> hiddensPanel = new HashMap<String, CollapsiblePanel>();
|
|
||||||
Set<CollapsiblePanel> visiblePanel = new HashSet<CollapsiblePanel>();
|
|
||||||
for (int i = 0; i < comps.length; i++) {
|
for (int i = 0; i < comps.length; i++) {
|
||||||
Component comp = comps[i];
|
Component comp = comps[i];
|
||||||
|
|
||||||
if (comp instanceof CollapsiblePanel)
|
if (comp instanceof CollapsiblePanel)
|
||||||
{
|
{
|
||||||
if (comp.getName() != null && !comp.getName().startsWith("IncludedTab#"))
|
if (comp.getName() == null || comp.getName().startsWith("IncludedTab#"))
|
||||||
hiddensPanel.put(comp.getName(), (CollapsiblePanel)comp);
|
continue;
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
boolean hasVisible = false;
|
||||||
String columnName = comp.getName();
|
Component[] childs = ((CollapsiblePanel)comp).getCollapsiblePane().getContentPane().getComponents();
|
||||||
if (columnName != null && columnName.length() > 0) {
|
for (int j = 0; j < childs.length; j++) {
|
||||||
GridField mField = m_mTab.getField(columnName);
|
if (childs[j].isVisible())
|
||||||
if (mField != null)
|
|
||||||
{
|
|
||||||
String fieldGroup = mField.getFieldGroup();
|
|
||||||
if (fieldGroup != null && fieldGroup.length() > 0)
|
|
||||||
{
|
{
|
||||||
if (hiddensPanel.containsKey(fieldGroup) && !hiddens.contains(columnName))
|
String columnName = childs[j].getName();
|
||||||
|
if (columnName != null && columnName.length() > 0)
|
||||||
{
|
{
|
||||||
visiblePanel.add((CollapsiblePanel)hiddensPanel.remove(fieldGroup));
|
GridField mField = m_mTab.getField(columnName);
|
||||||
|
if (mField != null)
|
||||||
|
{
|
||||||
|
hasVisible = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (comp.isVisible() != hasVisible)
|
||||||
|
comp.setVisible(hasVisible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CollapsiblePanel panel : hiddensPanel.values())
|
|
||||||
{
|
|
||||||
if (panel.isVisible())
|
|
||||||
panel.setVisible(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (CollapsiblePanel panel : visiblePanel)
|
|
||||||
{
|
|
||||||
if (!panel.isVisible())
|
|
||||||
panel.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
log.config(m_mTab.toString() + " - fini - "
|
log.config(m_mTab.toString() + " - fini - "
|
||||||
|
|
Loading…
Reference in New Issue