Domanda

I am using Struts 2 jquery plugin's dropdown list. i want to submit the form which has this dropdown and want to give the target to some other div.please give some idea.Thanking you in advance. here is the code:

         <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>
È stato utile?

Soluzione

try:

         <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> 

UPDATE

If you have a action like this:

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

You can load your div easily like this:

<s:url var="remoteUrl" action="daySubmitAction2"/>
<sj:div href="%{remoteUrl}/>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top