IDEMPIERE-5528 : Default logic on process dialog not getting value from tab. (#1634)
This commit is contained in:
parent
0d1ef0ae77
commit
7ab1e8c3d5
|
@ -844,7 +844,7 @@ public class GridField
|
|||
if (defStr.equals("@SysDate@")) // System Time
|
||||
return new Timestamp (System.currentTimeMillis());
|
||||
else if (defStr.indexOf('@') != -1) // it is a variable
|
||||
defStr = Env.parseContext(m_vo.ctx, m_vo.WindowNo, defStr.trim(), false, false);
|
||||
defStr = Env.parseContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, defStr.trim(), false, false);
|
||||
else if (defStr.indexOf("'") != -1) // it is a 'String'
|
||||
defStr = defStr.replace('\'', ' ').trim();
|
||||
|
||||
|
|
|
@ -331,7 +331,18 @@ public class GridFieldVO implements Serializable, Cloneable
|
|||
*/
|
||||
public static GridFieldVO createParameter (Properties ctx, int WindowNo, int ProcessIDOfPanel, int WindowIDOfPanel, int InfoWindowIDOfPanel, ResultSet rs)
|
||||
{
|
||||
GridFieldVO vo = new GridFieldVO (ctx, WindowNo, 0, 0, 0, false);
|
||||
return GridFieldVO.createParameter(ctx, WindowNo, 0, ProcessIDOfPanel, WindowIDOfPanel, InfoWindowIDOfPanel, rs);
|
||||
}
|
||||
/**
|
||||
* Init Field for Process Parameter
|
||||
* @param ctx context
|
||||
* @param WindowNo window
|
||||
* @param rs result set AD_Process_Para
|
||||
* @return MFieldVO
|
||||
*/
|
||||
public static GridFieldVO createParameter (Properties ctx, int WindowNo, int TabNo, int ProcessIDOfPanel, int WindowIDOfPanel, int InfoWindowIDOfPanel, ResultSet rs)
|
||||
{
|
||||
GridFieldVO vo = new GridFieldVO (ctx, WindowNo, TabNo, 0, 0, false);
|
||||
vo.isProcess = true;
|
||||
vo.IsDisplayed = true;
|
||||
vo.IsReadOnly = false;
|
||||
|
|
|
@ -3713,7 +3713,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
}
|
||||
}
|
||||
|
||||
ProcessModalDialog dialog = new ProcessModalDialog(this, curWindowNo, pi, startWOasking);
|
||||
ProcessModalDialog dialog = new ProcessModalDialog(this, curWindowNo, adtabPanel.getGridTab().getTabNo(), pi, startWOasking);
|
||||
|
||||
if (dialog.isValid())
|
||||
{
|
||||
|
|
|
@ -114,6 +114,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
|
|||
private static final CLogger log = CLogger.getCLogger(AbstractProcessDialog.class);
|
||||
|
||||
protected int m_WindowNo;
|
||||
protected int m_TabNo;
|
||||
private Properties m_ctx;
|
||||
private int m_AD_Process_ID;
|
||||
private ProcessInfo m_pi = null;
|
||||
|
@ -157,9 +158,27 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
|
|||
* @return
|
||||
*/
|
||||
protected boolean init(Properties ctx, int WindowNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete)
|
||||
{
|
||||
return init(ctx, WindowNo, 0, AD_Process_ID, pi, autoStart, isDisposeOnComplete);
|
||||
}
|
||||
|
||||
/**
|
||||
* layout as below
|
||||
*
|
||||
* @param ctx
|
||||
* @param WindowNo
|
||||
* @param TabNo
|
||||
* @param AD_Process_ID
|
||||
* @param pi
|
||||
* @param autoStart
|
||||
* @param isDisposeOnComplete
|
||||
* @return
|
||||
*/
|
||||
protected boolean init(Properties ctx, int WindowNo, int TabNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete)
|
||||
{
|
||||
m_ctx = ctx;
|
||||
m_WindowNo = WindowNo;
|
||||
m_TabNo = TabNo;
|
||||
m_AD_Process_ID = AD_Process_ID;
|
||||
setProcessInfo(pi);
|
||||
m_disposeOnComplete = isDisposeOnComplete;
|
||||
|
@ -214,7 +233,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
|
|||
m_pi.setTitle(m_Name);
|
||||
m_pi.setAD_Process_UU(m_AD_Process_UU);
|
||||
|
||||
parameterPanel = new ProcessParameterPanel(m_WindowNo, m_pi);
|
||||
parameterPanel = new ProcessParameterPanel(m_WindowNo, m_TabNo, m_pi);
|
||||
if ( !parameterPanel.init() ) {
|
||||
if (m_ShowHelp != null && MProcess.SHOWHELP_DonTShowHelp.equals(m_ShowHelp))
|
||||
autoStart = true;
|
||||
|
|
|
@ -116,6 +116,18 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi
|
|||
* @param autoStart
|
||||
*/
|
||||
public ProcessModalDialog(EventListener<Event> listener, int WindowNo, ProcessInfo pi, boolean autoStart)
|
||||
{
|
||||
this(listener, WindowNo, 0, pi, autoStart);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
* @param WindowNo
|
||||
* @param TabNo
|
||||
* @param pi
|
||||
* @param autoStart
|
||||
*/
|
||||
public ProcessModalDialog(EventListener<Event> listener, int WindowNo, int TabNo, ProcessInfo pi, boolean autoStart)
|
||||
{
|
||||
super();
|
||||
|
||||
|
@ -128,7 +140,7 @@ public class ProcessModalDialog extends AbstractProcessDialog implements EventLi
|
|||
log.info("Process=" + pi.getAD_Process_ID());
|
||||
try
|
||||
{
|
||||
init(Env.getCtx(), WindowNo, pi.getAD_Process_ID(), pi, autoStart, true);
|
||||
init(Env.getCtx(), WindowNo, TabNo, pi.getAD_Process_ID(), pi, autoStart, true);
|
||||
if (mainParameterLayout != null)// when auto start it's null
|
||||
{
|
||||
mainParameterLayout.setStyle("max-height:" + ClientInfo.get().desktopHeight + "px");
|
||||
|
|
|
@ -107,8 +107,23 @@ public class ProcessParameterPanel extends Panel implements
|
|||
* process info
|
||||
*/
|
||||
public ProcessParameterPanel(int WindowNo, ProcessInfo pi) {
|
||||
this(WindowNo, 0, pi);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dynamic generated Parameter panel.
|
||||
*
|
||||
* @param WindowNo
|
||||
* window
|
||||
* @param tabNo
|
||||
* tabNo
|
||||
* @param pi
|
||||
* process info
|
||||
*/
|
||||
public ProcessParameterPanel(int WindowNo,int tabNo, ProcessInfo pi) {
|
||||
//
|
||||
m_WindowNo = WindowNo;
|
||||
m_TabNo = tabNo;
|
||||
m_processInfo = pi;
|
||||
m_AD_Window_ID = AEnv.getADWindowID (WindowNo);
|
||||
this.m_InfoWindowID = pi.getAD_InfoWindow_ID();
|
||||
|
@ -134,6 +149,7 @@ public class ProcessParameterPanel extends Panel implements
|
|||
}
|
||||
|
||||
private int m_WindowNo;
|
||||
private int m_TabNo;
|
||||
private ProcessInfo m_processInfo;
|
||||
// AD_Window of window below this dialog in case show parameter dialog panel
|
||||
private int m_AD_Window_ID = 0;
|
||||
|
@ -269,7 +285,7 @@ public class ProcessParameterPanel extends Panel implements
|
|||
hasFields = true;
|
||||
|
||||
// Create Field
|
||||
GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, m_processInfo.getAD_Process_ID(), m_AD_Window_ID, m_InfoWindowID,rs);
|
||||
GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, m_TabNo, m_processInfo.getAD_Process_ID(), m_AD_Window_ID, m_InfoWindowID,rs);
|
||||
listVO.add(voF);
|
||||
}
|
||||
Collections.sort(listVO, new GridFieldVO.SeqNoComparator());
|
||||
|
|
Loading…
Reference in New Issue