在IE中,dijit.form.filteringselect的Spring.addElementDecoration失败

时间:2013-02-07 10:50:44

标签: spring dojo spring-roo

我正在使用Spring Roo创建一个调用ajax调用的页面,并使用Ajax调用中的搜索表单填充页面的一部分。这一切都是通过使用标准的Roo标签和Javascript库来完成的。 Ajax返回的表单很简单,只有一个选择列表。

<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields"
xmlns:form="urn:jsptagdir:/WEB-INF/tags/form"
xmlns:springform="http://www.springframework.org/tags/form" 
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags" version="2.0">
<div>
    <jsp:directive.page contentType="text/html;charset=UTF-8" />
    <jsp:output omit-xml-declaration="yes" />
    <form:search
        id="fc_domain_profile_combination"
        modelAttribute="combination" path="/profiles/search/combinations"
        z="e2lXrqKKD2CS7Zjefas2ZXPW4xYNM=">
        <field:select field="searchProcessingCenter" renderempty="true" disabled="true"
                id="c_profile_combofilter_processingcenter"
                items="${proccenters}" path="/profiles"
                itemLabel="name" itemValue="id"/>
    </form:search>
    <input type="hidden" id="blockSubmitHd" value="false" />
</div>

此代码在Firefox和Google Chrome中运行良好,但在IE中因“未知错误”而失败。问题发生在Roo中包含的Ajax方法中:

function callXhrGet(contentId, ajaxUrl){
  var _targetNode = dojo.byId(contentId);
  var xhrArgs = {
      url: ajaxUrl,
      preventCache: true,
      handleAs:"text",
      load: function(data) {
        dojo.html.set(_targetNode,data,{parseContent:true});
        dojo.forEach(dojo.query("script", _targetNode),function(node){
            dojo.eval(node.innerHTML);
        });
        dojo.parser.parse(_targetNode);
      },
      error: function(error) {
          _targetNode.innerHTML = "An unexpected error occurred: " + error;
      }
  };
  dojo.xhrGet(xhrArgs);

}

尝试处理以下行时dojo.eval(node.innerHTML);失败:

Spring.addDecoration(new Spring.ElementDecoration({elementId : '_searchProcessingCenter_id', widgetType: 'dijit.form.FilteringSelect', widgetAttrs : {hasDownArrow : true, required : false, invalidMessage: 'Please enter valid Role Type' }}));

有趣的是,当列表为空时它工作正常,其他dijit.form.tags也可以正常工作。有任何建议和反馈如何解决这个问题?

0 个答案:

没有答案