早段时间升级了STRUTS2到2.16版本,之前的<s:sumbit>没有了targets,和href等属性,我用了<sx:submit>
有这两个属性,我想做的功能是点击一个按钮执行到一个ACTION去,并返回页面。在IE中点击直接报undefined错误,
在google浏览器中可以执行到action,并返回页面。但是action所在的页的JS脚本执行不到,excuteScripts="true"我也加了,<sx:head />
也加了。
<s:form  action="...." theme="simple" method="post"> <s:url id="action1" value="shopCart_init.action"></s:url>
  <sx:submit targets="tar" value="修改" href="%{action1}" align="left" />
<sx:div id="tar" theme="ajax" executeScripts="true">
</sx:div>
           .......
           .....
</s:form>
各位大哥帮帮忙!

解决方案 »

  1.   

    There's a bug in IE6/IE7 which makes impossible to use the target's attribute with a parent Div, because such Div's content's are overwritten with the tag's loadingText. Resulting in an "undefined" message in the content's, instead of the result of the request.One possible alternative is to set showLoadingText="false"(the default) and set the indicator attribute to an element showing the desired loading text or image (outside the div).<img id="loadingImage" src="images/loadingAnimation.gif" style="display:none"/>
    <s:div id="parentDiv">
        <s:form action="actionName">
            <sx:submit  targets="parentDiv" showLoadingText="false" indicator="loadingImage"/>
        </s:form>
    </s:div>
    如有不明白请访问,http://struts.apache.org/2.0.14/docs/dojo-submit.html 这个问题,苦求好久没人回应,今日无意中在APACHE中搜索到的.希望
    对遇到同类问题的人有个帮助!
      

  2.   

    原来用的是STRUTS2 的标签 ,帮不上你什么忙了, 因为个人认为STRUTS的标签用起来太麻烦,没有多在意义。就没有研究过。  
      

  3.   

    我已经解决了啊,There's a bug in IE6/IE7 which makes impossible to use the target's attribute with a parent Div, because such Div's content's are overwritten with the tag's loadingText. Resulting in an "undefined" message in the content's, instead of the result of the request. One possible alternative is to set showLoadingText="false"(the default) and set the indicator attribute to an element showing the desired loading text or image (outside the div). <img id="loadingImage" src="images/loadingAnimation.gif" style="display:none"/> 
    <s:div id="parentDiv"> 
        <s:form action="actionName"> 
            <sx:submit  targets="parentDiv" showLoadingText="false" indicator="loadingImage"/> 
        </s:form> 
    </s:div> 
    这个就是解决方式!
      

  4.   

    还有一点就是,顺序依次是:
    img
    div
    formform 要  放在DIV里