Commit da065e86 by WeiCong

dsp修改

parent ad5888ba
...@@ -543,6 +543,9 @@ public class NoUiPresentation extends AbstractNullPresentation { ...@@ -543,6 +543,9 @@ public class NoUiPresentation extends AbstractNullPresentation {
HttpServletRequest req = ((NoUiContext) ctx).getNoUiRequest().getHttpRequest(); HttpServletRequest req = ((NoUiContext) ctx).getNoUiRequest().getHttpRequest();
HttpSession session = req.getSession(true); HttpSession session = req.getSession(true);
ZkContext zkContext = new ZkContext(ctx); ZkContext zkContext = new ZkContext(ctx);
if (panels != null && panels.length != 0) {
zkContext.setPanel(panels[0]);
}
ZkUtils.setZkContext(session,zkContext); ZkUtils.setZkContext(session,zkContext);
ServletContext servletContext = session.getServletContext(); ServletContext servletContext = session.getServletContext();
Session zkSession = WebManager.getSession(session.getServletContext(), req); Session zkSession = WebManager.getSession(session.getServletContext(), req);
......
...@@ -28,11 +28,11 @@ import java.util.*; ...@@ -28,11 +28,11 @@ import java.util.*;
public class NoUiPresentationUtil { public class NoUiPresentationUtil {
protected static final Log log = LogFactory.getLog(NoUiPresentationUtil.class); protected static final Log log = LogFactory.getLog(NoUiPresentationUtil.class);
public static void handleInput(){ public static void handleInput() {
NoUiContext noUiContext = NoUiContextManager.getNoUiContext(); NoUiContext noUiContext = NoUiContextManager.getNoUiContext();
NoUiRequest noUiRequest = NoUiContextManager.getNoUiRequest(); NoUiRequest noUiRequest = NoUiContextManager.getNoUiRequest();
Alias alias = AliasFactory.getAlias(noUiRequest.getMappingUrl(), noUiContext); Alias alias = AliasFactory.getAlias(noUiRequest.getMappingUrl(), noUiContext);
handleInput(noUiContext,noUiRequest,alias); handleInput(noUiContext, noUiRequest, alias);
} }
public static void handleInput(NoUiContext context, NoUiRequest request, Alias alias) { public static void handleInput(NoUiContext context, NoUiRequest request, Alias alias) {
...@@ -56,12 +56,10 @@ public class NoUiPresentationUtil { ...@@ -56,12 +56,10 @@ public class NoUiPresentationUtil {
throw new NoUiException("not found url :" + url + " ,alias name is:" + aliasKey); throw new NoUiException("not found url :" + url + " ,alias name is:" + aliasKey);
} else { } else {
Object value = dataMap.get(aliasKey); Object value = dataMap.get(aliasKey);
if (null != value) {
if (baseObject instanceof IDatafield<?>) { if (baseObject instanceof IDatafield<?>) {
IDatafield<Object> dataField = (IDatafield<Object>) baseObject; IDatafield<Object> dataField = (IDatafield<Object>) baseObject;
handleDatafield(context, dataField, value); handleDatafield(context, dataField, value);
} } else if (baseObject instanceof IModuleList<?> && null != value && value instanceof List<?>) {
if (baseObject instanceof IModuleList<?> && value instanceof List<?>) {
IModuleList<IModule> moduleList = (IModuleList<IModule>) baseObject; IModuleList<IModule> moduleList = (IModuleList<IModule>) baseObject;
moduleList.clear(); moduleList.clear();
List<Map<String, Object>> valueList = (List<Map<String, Object>>) value; List<Map<String, Object>> valueList = (List<Map<String, Object>>) value;
...@@ -73,7 +71,6 @@ public class NoUiPresentationUtil { ...@@ -73,7 +71,6 @@ public class NoUiPresentationUtil {
} }
} }
} }
}
} catch (Exception e) { } catch (Exception e) {
log.error("Input command error", e); log.error("Input command error", e);
throw new NoUiException("Input command error", e); throw new NoUiException("Input command error", e);
...@@ -136,8 +133,13 @@ public class NoUiPresentationUtil { ...@@ -136,8 +133,13 @@ public class NoUiPresentationUtil {
} }
private static void handleDatafield(IContext context, IDatafield<Object> dataField, Object value) { private static void handleDatafield(IContext context, IDatafield<Object> dataField, Object value) {
if (null == value || dataField == null) if (dataField == null) {
return;
}
if (value == null) {
dataField.setValue(null);
return; return;
}
Class<?> dataType = dataField.getDataType(); Class<?> dataType = dataField.getDataType();
if (dataType.equals(String.class)) { if (dataType.equals(String.class)) {
String valStr = value.toString(); String valStr = value.toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment