Hi,
I am using struts 2.0.11. My problem is i have a tabbedpane having a number of tabs. I want to make a request to the server or call a javascript function when user click on a tab. So, i am using onclick event in side the tag, but its not working. The tab is passing the onclick event to the html elements in that tab view. Here is the code i am using to generate tabbed pane.
<s:tabbedPanel id="ic" closeButton="tab">
<s:iterator id="tab" value="#session.UserView.projects">
<s:div label="%{#tab.name}" theme="ajax" id="%{#tab.name}" onclick="alert('%{#tab.name}');">
<input type="button" id="test" value="click" />
</s div>
</s:iterator>
</s:tabbedPanel>
loop is executing 4 times.
When the code executes, its rendering 4 tabs having label 'project1' 'project2' 'project3' 'project4'
Now, suppose i click on the 'project1' tab, it should show the alert message. But, its not working when i click on the div, its working if i click on the button having id='test' inside the div.
Please, can anybody help?
Early response will be greatly appeciated,
Thanks in advance.
Dev.
Comments
Problem with Tabbedpane in struts 2.0.11
<s:tabbedPanel id="ic" closeButton="tab"> <s:iterator id="tab" value="#session.UserView.projects"> <s:div label="%{#tab.name}" theme="ajax" id="%{#tab.name}" onclick="alert('%{#tab.name}');"> <input type="button" id="test" value="click" /> </s div> </s:iterator> </s:tabbedPanel> loop is executing 4 times. When the code executes, its rendering 4 tabs having label 'project1' 'project2' 'project3' 'project4' Now, suppose i click on the 'project1' tab, it should show the alert message. But, its not working when i click on the div, its working if i click on the button having id='test' inside the div. Please, can anybody help? Early response will be greatly appeciated, Thanks in advance. Dev.