- 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();
}
} else {
Component cmp = row.getFirstChild().getFirstChild().getNextSibling();
Clients.response(new AuScript(null, "scrollToRow('" + cmp.getUuid() + "');"));
Component cmp = null;
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) {
List<?> list = row.getChildren();

View File

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