- product window broken when hiding initial column
This commit is contained in:
Heng Sin Low 2009-12-14 04:05:03 +00:00
parent 7e698c6883
commit 904289b63b
2 changed files with 41 additions and 18 deletions

View File

@ -462,8 +462,22 @@ public class GridPanel extends Borderlayout implements EventListener
renderer.setFocusToEditor(); renderer.setFocusToEditor();
} }
} else { } else {
Component cmp = row.getFirstChild().getFirstChild().getNextSibling(); Component cmp = null;
Clients.response(new AuScript(null, "scrollToRow('" + cmp.getUuid() + "');")); List<?> childs = row.getChildren();
for (Object o : childs) {
Component c = (Component) o;
if (!c.isVisible())
continue;
c = c.getFirstChild();
if (c == null)
continue;
if (c.getNextSibling() != null) {
cmp = c.getNextSibling();
break;
}
}
if (cmp != null)
Clients.response(new AuScript(null, "scrollToRow('" + cmp.getUuid() + "');"));
if (columnOnClick != null && columnOnClick.trim().length() > 0) { if (columnOnClick != null && columnOnClick.trim().length() > 0) {
List<?> list = row.getChildren(); List<?> list = row.getChildren();

View File

@ -26,6 +26,7 @@ package org.adempiere.webui.panel;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Properties; import java.util.Properties;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.logging.Level;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
@ -45,6 +46,7 @@ import org.adempiere.webui.window.LoginWindow;
import org.compiere.Adempiere; import org.compiere.Adempiere;
import org.compiere.model.MSession; import org.compiere.model.MSession;
import org.compiere.model.MUser; import org.compiere.model.MUser;
import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
@ -87,6 +89,7 @@ public class LoginPanel extends Window implements EventListener
private static final long serialVersionUID = 3992171368813030624L; private static final long serialVersionUID = 3992171368813030624L;
private static final String RESOURCE = "org.compiere.apps.ALoginRes"; private static final String RESOURCE = "org.compiere.apps.ALoginRes";
private ResourceBundle res = ResourceBundle.getBundle(RESOURCE); private ResourceBundle res = ResourceBundle.getBundle(RESOURCE);
private static CLogger logger = CLogger.getCLogger(LoginPanel.class);
private Properties ctx; private Properties ctx;
private Label lblUserId; private Label lblUserId;
@ -202,25 +205,31 @@ public class LoginPanel extends Window implements EventListener
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
String[] data = (String[]) event.getData(); String[] data = (String[]) event.getData();
int AD_Session_ID = Integer.parseInt(data[0]); try
MSession session = new MSession(Env.getCtx(), AD_Session_ID, null);
if (session.get_ID() == AD_Session_ID)
{ {
int AD_User_ID = session.getCreatedBy(); int AD_Session_ID = Integer.parseInt(data[0]);
MUser user = MUser.get(Env.getCtx(), AD_User_ID); MSession session = new MSession(Env.getCtx(), AD_Session_ID, null);
if (user != null && user.get_ID() == AD_User_ID) if (session.get_ID() == AD_Session_ID)
{ {
String token = data[1]; int AD_User_ID = session.getCreatedBy();
if (BrowserToken.validateToken(session, user, token)) MUser user = MUser.get(Env.getCtx(), AD_User_ID);
{ if (user != null && user.get_ID() == AD_User_ID)
txtUserId.setValue(user.getName()); {
onUserIdChange(); String token = data[1];
txtPassword.setValue(token); if (BrowserToken.validateToken(session, user, token))
txtPassword.setAttribute("user.token.hash", token); {
txtPassword.setAttribute("user.token.sid", AD_Session_ID); txtUserId.setValue(user.getName());
chkRememberMe.setChecked(true); onUserIdChange();
} txtPassword.setValue(token);
txtPassword.setAttribute("user.token.hash", token);
txtPassword.setAttribute("user.token.sid", AD_Session_ID);
chkRememberMe.setChecked(true);
}
}
} }
} catch (Exception e) {
//safe to ignore
logger.log(Level.INFO, e.getLocalizedMessage(), e);
} }
} }
}); });