Merge with release-1.0c

This commit is contained in:
Elaine Tan 2013-12-02 19:25:06 +08:00
commit f9b81ab26e
5 changed files with 51 additions and 19 deletions

View File

@ -3187,13 +3187,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
int parentLevel = currentLevel-1;
if (parentLevel < 0)
return tabNo;
while (parentLevel != currentLevel)
{
tabNo--;
currentLevel = Env.getContextAsInt(m_vo.ctx, m_vo.WindowNo, tabNo, GridTab.CTX_TabLevel);
if (tabNo == 0)
break;
}
while (parentLevel != currentLevel)
{
tabNo--;
currentLevel = Env.getContextAsInt(m_vo.ctx, m_vo.WindowNo, tabNo, GridTab.CTX_TabLevel);
if (tabNo == 0)
break;
}
return tabNo;
}

View File

@ -166,6 +166,7 @@ public class GridWindow implements Serializable
if (mTabVO != null)
{
GridTab mTab = new GridTab(mTabVO, this, m_virtual);
Env.setContext(m_vo.ctx, m_vo.WindowNo, t, GridTab.CTX_TabLevel, Integer.toString(mTab.getTabLevel()));
m_tabs.add(mTab);
}
} // for all tabs

View File

@ -417,6 +417,8 @@ public class ProcessModalDialog extends Window implements EventListener<Event>,
}
private void onOK() {
if (!parameterPanel.validateParameters())
return;
this.startProcess();
}

View File

@ -71,7 +71,7 @@ public class InfoProductWindow extends InfoWindow {
private Textbox fieldDescription;
/** ASI */
private int m_M_AttributeSetInstance_ID;
protected int m_M_AttributeSetInstance_ID;
private Borderlayout contentBorderLayout;
@ -121,6 +121,24 @@ public class InfoProductWindow extends InfoWindow {
}
where.append("p.IsSummary='N' ");
}
for(WEditor editor : editors) {
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("C_BPartner_ID")) {
Number value = (Number) editor.getValue();
if (value == null || value.intValue() == 0)
{
if (where.length() > 0) {
where.append(" AND ");
}
where.append("CASE WHEN ppo.m_product_id > 0 THEN ppo.C_BPartner_ID IN (");
where.append("SELECT MAX(ppo.C_BPartner_ID) FROM M_Product_PO ppo ");
where.append("WHERE p.M_Product_ID=ppo.M_Product_ID AND ppo.IsCurrentVendor='Y' AND ppo.IsActive='Y') ");
where.append("ELSE 1 = 1 END ");
}
break;
}
}
return where.toString();
}

View File

@ -69,8 +69,15 @@ public class SessionContextListener implements ExecutionInit,
*/
public static void setupExecutionContextFromSession(Execution exec) {
Session session = exec.getDesktop().getSession();
Properties ctx = (Properties)session.getAttribute(SESSION_CTX);
HttpSession httpSession = (HttpSession)session.getNativeSession();
Properties ctx = null;
//catch potential Session already invalidated exception
boolean sessionInvalidated = false;
try {
ctx = (Properties)session.getAttribute(SESSION_CTX);
} catch (IllegalStateException e) {
sessionInvalidated = true;
}
HttpSession httpSession = sessionInvalidated ? null : (HttpSession)session.getNativeSession();
//create empty context if there's no valid native session
if (httpSession == null)
{
@ -217,14 +224,10 @@ public class SessionContextListener implements ExecutionInit,
public void complete(Component comp, Event evt) throws Exception
{
//in servlet thread
try {
if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid())
{
setupExecutionContextFromSession(Executions.getCurrent());
}
} catch (IllegalStateException e) {
//safe to ignore session already invalidated
}
if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid())
{
setupExecutionContextFromSession(Executions.getCurrent());
}
}
/**
@ -309,7 +312,13 @@ public class SessionContextListener implements ExecutionInit,
return false;
}
Properties sessionCtx = (Properties) session.getAttribute(SESSION_CTX);
Properties sessionCtx = null;
//catch invalidated session exception
try {
sessionCtx = (Properties) session.getAttribute(SESSION_CTX);
} catch (IllegalStateException e) {
return false;
}
if (sessionCtx != null)
{
if (Env.getAD_Client_ID(sessionCtx) != Env.getAD_Client_ID(ctx))
@ -341,6 +350,8 @@ public class SessionContextListener implements ExecutionInit,
if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid())
{
setupExecutionContextFromSession(Executions.getCurrent());
if (Env.getCtx().getProperty(SERVLET_SESSION_ID) == null)
return;
}
int AD_Session_ID = Env.getContextAsInt(Env.getCtx(), "#AD_Session_ID");
if (AD_Session_ID > 0) {