0

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 ?

Atul
  • 1,560
  • 5
  • 30
  • 75

1 Answers1

3

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.

Quincy
  • 4,393
  • 3
  • 26
  • 40
  • ,thanks a lot, adding onChangetopics to sj:tabbedpanel instead of sj:tab solved the issue. Thanks a lot. – Atul Nov 02 '12 at 11:07