IDEMPIERE-1259 Red mandatory label not cleared when moving to non-mandatory.

This commit is contained in:
Heng Sin Low 2013-08-14 15:04:17 +08:00
parent f94aef8b98
commit ea449dbd6b
3 changed files with 21 additions and 10 deletions

View File

@ -668,11 +668,6 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
collapsedGroups.add(group); collapsedGroups.add(group);
} }
for (WEditor comp : editors)
{
comp.updateLabelStyle();
}
// Selective // Selective
if (col > 0) if (col > 0)
{ {
@ -683,7 +678,12 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
+ columnName + " - Dependents=" + dependants.size()); + columnName + " - Dependents=" + dependants.size());
if ( ! ( dependants.size() > 0 if ( ! ( dependants.size() > 0
|| changedField.getCallout().length() > 0 || changedField.getCallout().length() > 0
|| Core.findCallout(gridTab.getTableName(), columnName).size() > 0)) { || Core.findCallout(gridTab.getTableName(), columnName).size() > 0))
{
for (WEditor comp : editors)
{
comp.updateLabelStyle();
}
return; return;
} }
} }
@ -719,6 +719,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
comp.setVisible(false); comp.setVisible(false);
} }
} }
comp.updateLabelStyle();
} // all components } // all components
//hide row if all editor within the row is invisible //hide row if all editor within the row is invisible

View File

@ -101,6 +101,7 @@ public class ProcessParameterPanel extends Panel implements
this.width = width; this.width = width;
// //
initComponent(); initComponent();
addEventListener("onDynamicDisplay", this);
} // ProcessParameterPanel } // ProcessParameterPanel
private void initComponent() { private void initComponent() {
@ -566,6 +567,9 @@ public class ProcessParameterPanel extends Panel implements
} }
} }
} }
else if (event.getName().equals("onDynamicDisplay")) {
dynamicDisplay();
}
} }
/** /**
@ -623,7 +627,7 @@ public class ProcessParameterPanel extends Panel implements
else else
Env.setContext(Env.getCtx(), m_WindowNo, name, value.toString()); Env.setContext(Env.getCtx(), m_WindowNo, name, value.toString());
dynamicDisplay(); Events.postEvent("onDynamicDisplay", this, (Object)null);
} }
private void dynamicDisplay() { private void dynamicDisplay() {
@ -653,6 +657,7 @@ public class ProcessParameterPanel extends Panel implements
m_wEditors2.get(i).setVisible(false); m_wEditors2.get(i).setVisible(false);
} }
} }
editor.setMandatory(mField.isMandatory(true));
editor.updateLabelStyle(); editor.updateLabelStyle();
} }
} }

View File

@ -458,11 +458,16 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
* @param mandatory whether the field is mandatory * @param mandatory whether the field is mandatory
*/ */
public void setMandatory (boolean mandatory) public void setMandatory (boolean mandatory)
{
if (this.mandatory != mandatory)
{ {
this.mandatory = mandatory; this.mandatory = mandatory;
if (label != null) if (label != null)
{
label.setMandatory(mandatory); label.setMandatory(mandatory);
} }
}
}
/** /**
* *