0

我正在使用 Struts 2 jquery 插件的下拉列表。我想提交具有此下拉列表的表单,并希望将目标提供给其他 div。请给出一些想法。提前谢谢你。这是代码:

         <sj:select 
          list="dayList" 
          href="%{idDayList}"
          title="Select day"
          id="dayId" headerKey="-1"
          headerValue="-----Select Day-----" 
          targets="rightBottomDiv"/>   


<sj:div id="rightBottomDiv"  formIds="idLeftForm"  cssStyle="height:100%;width:100%;background-color:#dfdsf;"                                        draggableRevert="invalid" cssClass="accept ui-widget-content ui-corner-all" >
          <jsp:include page="templateRightBottomDiv.jsp"/>
          </sj:div>
<action name="daySubmitAction2"  method="divRefreshMethod" class="com.ebhasin.fitnessbliss.actions.templateExerciseAction">
                <result  name="success">/jsps/templateRightBottomDiv.jsp</result>
            </action>
4

1 回答 1

0

尝试:

         <sj:select 
          list="dayList" 
          href="%{idDayList}"
          title="Select day"
          id="dayId" headerKey="-1"
          headerValue="-----Select Day-----" 
          targets="rightBottomDiv"
          onChangeTopics="somethingHappened"/>

<script>
    $.subscribe('somethingHappened', function(){
        $("your-form-selector").submit();
    });
</script> 

更新

如果您有这样的操作:

<action name="daySubmitAction2"  method="divRefreshMethod" class="com.ebhasin.fitnessbliss.actions.templateExerciseAction">
    <result name="success">/jsps/templateRightBottomDiv.jsp</result>
</action>

您可以div像这样轻松加载:

<s:url var="remoteUrl" action="daySubmitAction2"/>
<sj:div href="%{remoteUrl}/>
于 2012-10-18T09:53:50.997 回答