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);
}
for (WEditor comp : editors)
{
comp.updateLabelStyle();
}
// Selective
if (col > 0)
{
@ -683,7 +678,12 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
+ columnName + " - Dependents=" + dependants.size());
if ( ! ( dependants.size() > 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;
}
}
@ -719,6 +719,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
comp.setVisible(false);
}
}
comp.updateLabelStyle();
} // all components
//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;
//
initComponent();
addEventListener("onDynamicDisplay", this);
} // ProcessParameterPanel
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
Env.setContext(Env.getCtx(), m_WindowNo, name, value.toString());
dynamicDisplay();
Events.postEvent("onDynamicDisplay", this, (Object)null);
}
private void dynamicDisplay() {
@ -653,6 +657,7 @@ public class ProcessParameterPanel extends Panel implements
m_wEditors2.get(i).setVisible(false);
}
}
editor.setMandatory(mField.isMandatory(true));
editor.updateLabelStyle();
}
}

View File

@ -459,9 +459,14 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
*/
public void setMandatory (boolean mandatory)
{
this.mandatory = mandatory;
if (label != null)
label.setMandatory(mandatory);
if (this.mandatory != mandatory)
{
this.mandatory = mandatory;
if (label != null)
{
label.setMandatory(mandatory);
}
}
}
/**