use of org.zkoss.zk.au.out.AuScript in project adempiere by adempiere.
the class GridPanel method focusToRow.
private void focusToRow(org.zkoss.zul.Row row) {
if (renderer.isEditing()) {
if (columnOnClick != null && columnOnClick.trim().length() > 0) {
setFocusToField(columnOnClick);
columnOnClick = null;
} else {
renderer.setFocusToEditor();
}
} else {
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();
for (Object element : list) {
if (element instanceof Div) {
Div div = (Div) element;
if (columnOnClick.equals(div.getAttribute("columnName"))) {
cmp = div.getFirstChild().getNextSibling();
Clients.response(new AuScript(null, "scrollToRow('" + cmp.getUuid() + "');"));
break;
}
}
}
columnOnClick = null;
}
}
}
use of org.zkoss.zk.au.out.AuScript in project adempiere by adempiere.
the class BrowserToken method save.
/**
* save session and user as client side token for future auto login
* @param session
* @param user
*/
public static void save(MSession session, MUser user) {
try {
String home = getHomeToken();
String hash = getPasswordHash(session, user);
String script = "adempiere.saveUserToken('" + home + "', '" + hash + "', '" + session.getAD_Session_ID() + "');";
AuScript aus = new AuScript(null, script);
Clients.response("saveUserToken", aus);
} catch (Exception e) {
log.log(Level.WARNING, e.getLocalizedMessage(), e);
}
}
use of org.zkoss.zk.au.out.AuScript in project adempiere by adempiere.
the class BrowserToken method remove.
/**
* remove client side token for auto login
*/
public static void remove() {
try {
String home = getHomeToken();
String script = "adempiere.removeUserToken('" + home + "');";
AuScript aus = new AuScript(null, script);
Clients.response("removeUserToken", aus);
} catch (Exception e) {
log.log(Level.WARNING, e.getLocalizedMessage(), e);
}
}
use of org.zkoss.zk.au.out.AuScript in project adempiere by adempiere.
the class BrowserToken method load.
/**
* load stored client side token for auto login
* @param cmpid
*/
public static void load(String cmpid) {
//remember me
try {
String home = getHomeToken();
String script = "adempiere.findUserToken('" + cmpid + "', '" + home + "');";
AuScript aus = new AuScript(null, script);
Clients.response("findUserToken", aus);
} catch (Exception e) {
log.log(Level.WARNING, e.getLocalizedMessage(), e);
}
}
use of org.zkoss.zk.au.out.AuScript in project adempiere by adempiere.
the class ThemeUtils method sendDeferLayoutEvent.
/**
* @param layout
*/
public static void sendDeferLayoutEvent(Borderlayout layout, int timeout) {
StringBuilder content = new StringBuilder();
content.append("ad_deferRenderBorderLayout('").append(layout.getUuid()).append("',").append(timeout).append(");");
AuScript as = new AuScript(null, content.toString());
Clients.response("deferRenderBorderLayout", as);
}
Aggregations