use of com.genexus.webpanels.WebSession in project JavaClasses by genexuslabs.
the class GXGridStateHandler method saveGridState.
public void saveGridState() {
WebSession session = ((HttpContext) context.getHttpContext()).getWebSession();
state.fromJSonString(session.getValue(gridName));
runVarsToState();
session.setValue(gridName, state.toJSonString());
dirty = true;
}
use of com.genexus.webpanels.WebSession in project JavaClasses by genexuslabs.
the class GXGridStateHandler method getState.
public SdtGridState getState() {
try {
if (dirty || state == null) {
HttpContext httpContext = (HttpContext) context.getHttpContext();
WebSession session = httpContext.getWebSession();
state = new SdtGridState(context);
state.fromJSonString(session.getValue(gridName));
dirty = false;
}
return state;
} catch (Exception ex) {
logger.error("Can't create " + sdtGridStateClass, ex);
return null;
}
}
use of com.genexus.webpanels.WebSession in project JavaClasses by genexuslabs.
the class GXGridStateHandler method loadGridState.
public void loadGridState() {
HttpContext httpContext = (HttpContext) context.getHttpContext();
HttpRequest httpRequest = httpContext.getHttpRequest();
if (GXutil.strcmp(httpRequest.getMethod(), "GET") == 0) {
WebSession session = httpContext.getWebSession();
state = new SdtGridState(context);
state.fromJSonString(session.getValue(gridName));
runVarsFromState();
dirty = true;
}
}
use of com.genexus.webpanels.WebSession in project JavaClasses by genexuslabs.
the class HttpContext method getLanguage.
public String getLanguage() {
if (currentLanguage == null) {
WebSession session = getWebSession();
String language = session != null ? session.getAttribute(GXLanguage) : null;
if (language != null && !language.equals("")) {
currentLanguage = language;
} else {
// Por ahora obtengo el del modelo, mas adelante puede haber uno por cada session
currentLanguage = Application.getClientPreferences().getProperty("LANG_NAME", "English");
}
}
return currentLanguage;
}
use of com.genexus.webpanels.WebSession in project JavaClasses by genexuslabs.
the class GXGridStateHandler method setState.
public void setState(SdtGridState state) {
this.state = state;
String jsonState = state.toJSonString();
HttpContext httpContext = (HttpContext) context.getHttpContext();
WebSession session = httpContext.getWebSession();
session.setValue(gridName, jsonState);
}
Aggregations