在java webapp中提交表单失败后,ajax响应会丢失

时间:2014-04-30 18:18:18

标签: java ajax forms web-applications response

我有一个表单,其中包含从ajax响应填充的字段,但是当我提交表单时出现一些验证错误,然后表单提交失败,但是我无法重新获得相同的问题表单,其中包含已通过ajax响应填充的字段。它们将状态显示为初始表单加载。

private ActionResult updateAlertTemplate(final Control source,
        final JQEvent event, final String globalFormatYN, final Form form) {
    final JQTaconite actionResult = new JQTaconite();
    new WithTransaction<Object>() {
        @Override
        protected Object execute0(final DatabaseSession s,
                final Object... args) {
            final Field sel = form.getField("format");
            if (globalFormatYN.equals("G")) {
                final String eventcode = (String) getContext().getSession()
                        .getAttribute("eventCode0");
                final String channel = (String) getContext().getSession()
                        .getAttribute("channel0");
                ProgramUtils.fillAlertTemplate(s, sel, eventcode, channel);
            }
            // sel.setStyle("width", "200px");
            actionResult.replace(sel);
            return null;
        }
    }.execute();
    return actionResult;
} its an apache click code

0 个答案:

没有答案