IDEMPIERE-1378:Info Windows : add a button to reset all criteria
This commit is contained in:
parent
c5757678d2
commit
0d9069512f
|
@ -78,9 +78,12 @@ public class InfoBPartnerWindow extends InfoWindow {
|
||||||
ih = null;
|
ih = null;
|
||||||
} // showHistory
|
} // showHistory
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
* set value of checkbox IsVendor and IsCustomer by IsSOTrx flag
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void createParameterPanel() {
|
protected void initParameters() {
|
||||||
super.createParameterPanel();
|
|
||||||
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
||||||
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
||||||
isSOTrx = "Y";
|
isSOTrx = "Y";
|
||||||
|
@ -88,6 +91,7 @@ public class InfoBPartnerWindow extends InfoWindow {
|
||||||
|
|
||||||
if (!Util.isEmpty(isSOTrx)) {
|
if (!Util.isEmpty(isSOTrx)) {
|
||||||
if ("Y".equals(isSOTrx)) {
|
if ("Y".equals(isSOTrx)) {
|
||||||
|
// set value of IsCustomer checkbox
|
||||||
for (WEditor editor : editors) {
|
for (WEditor editor : editors) {
|
||||||
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsCustomer")) {
|
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsCustomer")) {
|
||||||
editor.setValue("Y");
|
editor.setValue("Y");
|
||||||
|
@ -95,6 +99,7 @@ public class InfoBPartnerWindow extends InfoWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ("N".equals(isSOTrx)) {
|
} else if ("N".equals(isSOTrx)) {
|
||||||
|
// set value of IsVendor checkbox
|
||||||
for (WEditor editor : editors) {
|
for (WEditor editor : editors) {
|
||||||
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsVendor")) {
|
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsVendor")) {
|
||||||
editor.setValue("Y");
|
editor.setValue("Y");
|
||||||
|
@ -103,7 +108,6 @@ public class InfoBPartnerWindow extends InfoWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dynamicDisplay(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -51,14 +51,18 @@ public class InfoInOutWindow extends InfoWindow {
|
||||||
whereClause, AD_InfoWindow_ID, lookup);
|
whereClause, AD_InfoWindow_ID, lookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
* set value of checkbox isSoTrx
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void createParameterPanel() {
|
protected void initParameters() {
|
||||||
super.createParameterPanel();
|
|
||||||
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
||||||
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
||||||
isSOTrx = "Y";
|
isSOTrx = "Y";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set value of isSoTrx checkbox by env
|
||||||
if (!Util.isEmpty(isSOTrx)) {
|
if (!Util.isEmpty(isSOTrx)) {
|
||||||
for (WEditor editor : editors) {
|
for (WEditor editor : editors) {
|
||||||
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsSOTrx")) {
|
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsSOTrx")) {
|
||||||
|
@ -67,6 +71,6 @@ public class InfoInOutWindow extends InfoWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dynamicDisplay(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,9 +50,11 @@ public class InfoInvoiceWindow extends InfoWindow {
|
||||||
whereClause, AD_InfoWindow_ID, lookup);
|
whereClause, AD_InfoWindow_ID, lookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void createParameterPanel() {
|
protected void initParameters() {
|
||||||
super.createParameterPanel();
|
|
||||||
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
||||||
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
||||||
isSOTrx = "Y";
|
isSOTrx = "Y";
|
||||||
|
@ -77,7 +79,6 @@ public class InfoInvoiceWindow extends InfoWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dynamicDisplay(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -51,9 +51,11 @@ public class InfoOrderWindow extends InfoWindow {
|
||||||
whereClause, AD_InfoWindow_ID, lookup);
|
whereClause, AD_InfoWindow_ID, lookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void createParameterPanel() {
|
protected void initParameters() {
|
||||||
super.createParameterPanel();
|
|
||||||
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
||||||
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
||||||
isSOTrx = "Y";
|
isSOTrx = "Y";
|
||||||
|
@ -78,6 +80,5 @@ public class InfoOrderWindow extends InfoWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dynamicDisplay(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class InfoPAttributeInstanceWindow extends InfoWindow {
|
||||||
String whereClause, int AD_InfoWindow_ID, boolean lookup) {
|
String whereClause, int AD_InfoWindow_ID, boolean lookup) {
|
||||||
super(WindowNo, tableName, keyColumn, queryValue, multipleSelection,
|
super(WindowNo, tableName, keyColumn, queryValue, multipleSelection,
|
||||||
whereClause, AD_InfoWindow_ID, lookup);
|
whereClause, AD_InfoWindow_ID, lookup);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class InfoPAttributeWindow extends InfoWindow {
|
||||||
String whereClause, int AD_InfoWindow_ID) {
|
String whereClause, int AD_InfoWindow_ID) {
|
||||||
super(WindowNo, tableName, keyColumn, queryValue, multipleSelection,
|
super(WindowNo, tableName, keyColumn, queryValue, multipleSelection,
|
||||||
whereClause, AD_InfoWindow_ID);
|
whereClause, AD_InfoWindow_ID);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +46,7 @@ public class InfoPAttributeWindow extends InfoWindow {
|
||||||
String whereClause, int AD_InfoWindow_ID, boolean lookup) {
|
String whereClause, int AD_InfoWindow_ID, boolean lookup) {
|
||||||
super(WindowNo, tableName, keyColumn, queryValue, multipleSelection,
|
super(WindowNo, tableName, keyColumn, queryValue, multipleSelection,
|
||||||
whereClause, AD_InfoWindow_ID, lookup);
|
whereClause, AD_InfoWindow_ID, lookup);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,11 @@ public class InfoPaymentWindow extends InfoWindow {
|
||||||
whereClause, AD_InfoWindow_ID, lookup);
|
whereClause, AD_InfoWindow_ID, lookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void createParameterPanel() {
|
protected void initParameters() {
|
||||||
super.createParameterPanel();
|
|
||||||
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
|
||||||
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
if (!isLookup() && Util.isEmpty(isSOTrx)) {
|
||||||
isSOTrx = "Y";
|
isSOTrx = "Y";
|
||||||
|
@ -67,6 +69,5 @@ public class InfoPaymentWindow extends InfoWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dynamicDisplay(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,15 +136,6 @@ public class InfoProductWindow extends InfoWindow {
|
||||||
return prevWhereClause;
|
return prevWhereClause;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void createParameterPanel() {
|
|
||||||
super.createParameterPanel();
|
|
||||||
initParameters();
|
|
||||||
dynamicDisplay(null);
|
|
||||||
// update display of mandatory field
|
|
||||||
validateParameters();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderWindow() {
|
protected void renderWindow() {
|
||||||
super.renderWindow();
|
super.renderWindow();
|
||||||
|
@ -445,7 +436,11 @@ public class InfoProductWindow extends InfoWindow {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initParameters() {
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void initParameters() {
|
||||||
int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_Warehouse_ID");
|
int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_Warehouse_ID");
|
||||||
int M_PriceList_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_PriceList_ID");
|
int M_PriceList_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_PriceList_ID");
|
||||||
|
|
||||||
|
|
|
@ -1096,6 +1096,8 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
evalDisplayLogic();
|
evalDisplayLogic();
|
||||||
|
initParameters();
|
||||||
|
dynamicDisplay(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void evalDisplayLogic() {
|
private void evalDisplayLogic() {
|
||||||
|
@ -1362,6 +1364,8 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
||||||
{
|
{
|
||||||
if (otherEditor == editor)
|
if (otherEditor == editor)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// reset value of WInfoPAttributeEditor to null when change M_AttributeSet_ID
|
||||||
if (asiChanged && otherEditor instanceof WInfoPAttributeEditor)
|
if (asiChanged && otherEditor instanceof WInfoPAttributeEditor)
|
||||||
((WInfoPAttributeEditor)otherEditor).clearWhereClause();
|
((WInfoPAttributeEditor)otherEditor).clearWhereClause();
|
||||||
|
|
||||||
|
@ -1404,6 +1408,38 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc-}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void resetParameters() {
|
||||||
|
// reset value of parameter to null, just reset display parameter
|
||||||
|
for (WEditor editor : editors) {
|
||||||
|
GridField gField = editor.getGridField();
|
||||||
|
if (gField == null || !gField.isDisplayed()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// just reset to default Field set explicit DefaultValue
|
||||||
|
Object resetValue = null;
|
||||||
|
if (! Util.isEmpty(gField.getVO().DefaultValue, true)) {
|
||||||
|
resetValue = gField.getDefault();
|
||||||
|
}
|
||||||
|
Object oldValue = gField.getValue();
|
||||||
|
gField.setValue(resetValue, true);
|
||||||
|
|
||||||
|
// call valueChange to update env
|
||||||
|
ValueChangeEvent changeEvent = new ValueChangeEvent (editor, "", oldValue, resetValue);
|
||||||
|
valueChange (changeEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// init again parameter
|
||||||
|
initParameters();
|
||||||
|
|
||||||
|
// filter dynamic value
|
||||||
|
dynamicDisplay(null);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageAttached(Page newpage, Page oldpage) {
|
public void onPageAttached(Page newpage, Page oldpage) {
|
||||||
super.onPageAttached(newpage, oldpage);
|
super.onPageAttached(newpage, oldpage);
|
||||||
|
|
|
@ -226,7 +226,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
||||||
setStyle("position: absolute");
|
setStyle("position: absolute");
|
||||||
}
|
}
|
||||||
|
|
||||||
confirmPanel = new ConfirmPanel(true, true, false, true, true, true); // Elaine 2008/12/16
|
confirmPanel = new ConfirmPanel(true, true, true, true, true, true); // Elaine 2008/12/16
|
||||||
confirmPanel.addActionListener(Events.ON_CLICK, this);
|
confirmPanel.addActionListener(Events.ON_CLICK, this);
|
||||||
confirmPanel.setHflex("1");
|
confirmPanel.setHflex("1");
|
||||||
|
|
||||||
|
@ -1142,6 +1142,9 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
||||||
m_cancel = true;
|
m_cancel = true;
|
||||||
dispose(false);
|
dispose(false);
|
||||||
}
|
}
|
||||||
|
else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_RESET))) {
|
||||||
|
resetParameters ();
|
||||||
|
}
|
||||||
// Elaine 2008/12/16
|
// Elaine 2008/12/16
|
||||||
else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_HISTORY)))
|
else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_HISTORY)))
|
||||||
{
|
{
|
||||||
|
@ -1256,6 +1259,23 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call after load parameter panel to set init value can call when reset
|
||||||
|
* parameter implement this method at inheritance class
|
||||||
|
* with each parameter, remember call Env.setContext to set new value to env
|
||||||
|
*/
|
||||||
|
protected void initParameters() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset parameter to default value or to empty value? implement at
|
||||||
|
* inheritance class when reset parameter maybe need init again parameter,
|
||||||
|
* reset again default value
|
||||||
|
*/
|
||||||
|
protected void resetParameters() {
|
||||||
|
}
|
||||||
|
|
||||||
void preRunProcess (Integer processId){
|
void preRunProcess (Integer processId){
|
||||||
// disable all control button when run process
|
// disable all control button when run process
|
||||||
enableButtons(false);
|
enableButtons(false);
|
||||||
|
|
Loading…
Reference in New Issue