سؤال

I am using struts2-JQuery plugin to develope a UI. I want to capture onclick event for the tab. Below is the code for the jsp that creates multiple tabs

  <sj:tab id="tab2" target="selfCareDiv" label="Self Care"/>
  <sj:tab id="tab3" target="videoServiceDiv" label="Video Service"  onChangeTopics="changeTopic"/>
  <sj:tab id="tab4" target="deviceManagementDiv" label="Device Management"/>

    <div id="selfCareDiv">          
      <sj:tabbedpanel id="selfCareTab">
          <sj:tab id="tab7" href="%{remoteurl3}" label="Edit User"/>
      </sj:tabbedpanel> 
    </div>

    <div id="videoServiceDiv" class="vidDiv">           
      <sj:tabbedpanel id="videoServiceTab">         
          <sj:tab id="tab8" href="%{remoteurl7}" label="Stored Video"/> 
          <sj:tab id="tab9" href="%{remoteurl4}" label="Live Video"/>
      </sj:tabbedpanel>                  
    </div>

    <div id="deviceManagementDiv">          
      <sj:tabbedpanel id="deviceManagementTab">
          <sj:tab id="tab10" href="%{remoteurl5}" label="Add Device"/>
          <sj:tab id="tab11" href="%{remoteurl8}" label="Record"/>
      </sj:tabbedpanel>                  
    </div>
 </sj:tabbedpanel>

But the onChange topic is not getting fired for tab3 as shown in above code. Selected onChange topic based on the query asked : http://code.google.com/p/struts2-jquery/issues/detail?id=57.

Is there amy alternative possible ?

هل كانت مفيدة؟

المحلول

I think you should add the topic onChangeTopics in the sj:tabbedpanel element instead.

http://code.google.com/p/struts2-jquery/wiki/TabbedPanelTag#Topics

You can check which tab is selected from the callback function.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top