IDEMPIERE-4744 Minor improvements to Quick Form / Stay in Parent tab (#1239)

This commit is contained in:
Carlos Ruiz 2022-03-14 19:05:02 +01:00 committed by GitHub
parent 1a51e92c42
commit 2c08060361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 2 deletions

View File

@ -1199,7 +1199,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
/** /**
* Invoke when quick form is click * Invoke when quick form is click
*/ */
public void onQuickForm() public void onQuickForm() {
onQuickForm(false);
}
/**
* Invoke when quick form is click
* @param focusTabAtEnd the tab to return when finished
*/
public void onQuickForm(boolean stayInParent)
{ {
logger.log(Level.FINE, "Invoke Quick Form"); logger.log(Level.FINE, "Invoke Quick Form");
// Prevent to open Quick Form if already opened. // Prevent to open Quick Form if already opened.
@ -1227,6 +1235,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
form.setMaximizable(true); form.setMaximizable(true);
form.setMaximized(true); form.setMaximized(true);
form.setPosition("center"); form.setPosition("center");
form.setStayInParent(stayInParent);
ZKUpdateUtil.setWindowHeightX(form, 550); ZKUpdateUtil.setWindowHeightX(form, 550);
ZKUpdateUtil.setWindowWidthX(form, 900); ZKUpdateUtil.setWindowWidthX(form, 900);
ZkCssHelper.appendStyle(form, "z-index: 900;"); ZkCssHelper.appendStyle(form, "z-index: 900;");
@ -3996,6 +4005,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
return gridWindow; return gridWindow;
} }
/** /**
* set component of last focus editor. * set component of last focus editor.
* Use in onClose/Exit to restore focus * Use in onClose/Exit to restore focus

View File

@ -188,7 +188,7 @@ public class CompositeADTabbox extends AbstractADTabbox
if (result) if (result)
{ {
onEditDetail(row, formView); onEditDetail(row, formView);
adWindowPanel.onQuickForm(); adWindowPanel.onQuickForm(true);
} }
} }
}); });

View File

@ -83,6 +83,8 @@ public class WQuickForm extends Window implements IQuickForm
private int windowNo; private int windowNo;
private boolean stayInParent;
public WQuickForm(AbstractADWindowContent winContent, boolean m_onlyCurrentRows, int m_onlyCurrentDays) public WQuickForm(AbstractADWindowContent winContent, boolean m_onlyCurrentRows, int m_onlyCurrentDays)
{ {
super(); super();
@ -405,6 +407,10 @@ public class WQuickForm extends Window implements IQuickForm
adWinContent.setCurrQGV(null); adWinContent.setCurrQGV(null);
} }
adWinContent.getADTab().getSelectedTabpanel().query(onlyCurrentRows, onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); // autoSize adWinContent.getADTab().getSelectedTabpanel().query(onlyCurrentRows, onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); // autoSize
if (stayInParent) {
adWinContent.onParentRecord();
}
} // dispose } // dispose
private void createNewRow( ) private void createNewRow( )
@ -437,4 +443,13 @@ public class WQuickForm extends Window implements IQuickForm
int col = e.getChangedColumn(); int col = e.getChangedColumn();
quickGridView.dynamicDisplay(col); quickGridView.dynamicDisplay(col);
} // dataStatusChanged } // dataStatusChanged
/**
* Return to parent when closing the quick form
* @param stayInParent
*/
public void setStayInParent(boolean stayInParent) {
this.stayInParent = stayInParent;
}
} }