IDEMPIERE-1621 Mandatory field in process parameter panel not in red label

This commit is contained in:
Elaine Tan 2013-12-10 15:43:43 +08:00
parent 8f2813cd73
commit 486836db27
2 changed files with 16 additions and 3 deletions

View File

@ -281,7 +281,8 @@ public class ProcessParameterPanel extends Panel implements
Row row = new Row();
// The Editor
WEditor editor = WebEditorFactory.getEditor(mField, false);
WEditor editor = WebEditorFactory.getEditor(mField, false);
editor.setProcessParameter(true);
editor.getComponent().addEventListener(Events.ON_FOCUS, this);
editor.getComponent().addEventListener(Events.ON_BLUR, this);
editor.addValueChangeListener(this);
@ -336,6 +337,7 @@ public class ProcessParameterPanel extends Panel implements
m_mFields2.add(mField2);
// The Editor
WEditor editor2 = WebEditorFactory.getEditor(mField2, false);
editor2.setProcessParameter(true);
//override attribute
editor2.getComponent().setWidgetAttribute("columnName", mField2.getColumnName()+"_To");
editor2.getComponent().addEventListener(Events.ON_FOCUS, this);

View File

@ -91,6 +91,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
protected WEditorPopupMenu popupMenu;
private boolean tableEditor;
private boolean isProcessParameter;
public WEditor(Component comp, GridField gridField) {
this(comp, gridField, -1);
@ -208,7 +210,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
label = new Label("");
label.setValue(strLabel);
label.setTooltiptext(description);
label.setMandatory(mandatory);
this.setMandatory (mandatory);
if (readOnly || !updateable)
@ -546,7 +549,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
public boolean isMandatoryStyle() {
return mandatory && !readOnly && getGridField().isEditable(true) && isNullOrEmpty();
return mandatory && !readOnly && (isProcessParameter || getGridField().isEditable(true)) && isNullOrEmpty();
}
public boolean isNullOrEmpty() {
@ -632,6 +635,14 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
return false;
}
public boolean isProcessParameter() {
return isProcessParameter;
}
public void setProcessParameter(boolean isProcessParameter) {
this.isProcessParameter = isProcessParameter;
}
private static final String STYLE_ZOOMABLE_LABEL = "cursor: pointer; text-decoration: underline;";
private static final String STYLE_NORMAL_LABEL = "color: #333;";