hungsama / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

on(x) handlers for sj:tab not being copied into resulting html #664

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
(This is for feature requests and bugs in Struts2 jQuery Plugin - for
getting help, please use the User Group.
http://groups.google.com/group/struts2-jquery )

What steps will reproduce the problem?
1. add onclick to sj:tab tag
   <sj:tabbedpanel id="localtabs">
      <sj:tab id="tab1" target="productDetails" label="Product"/>
      <sj:tab id="tab2" target="customerDetails" label="Customer" onclick="alert()"/>
      <sj:tab id="tab3" target="repairDetails" label="Repair"/>
      <sj:tab id="tab4" target="shippingDetails" label="Shipping"/>
2.
3.

What is the expected output? What do you see instead?

Expect to see an alert when tab2 is clicked. What is actually rendered
in HTML is;

<div id="localtabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header 
ui-corner-all">
<li id="tab1" class="ui-state-default ui-corner-top">
<a title="Product" href="#productDetails">
<span>Product</span>
</a>
</li>
<li id="tab2" class="ui-state-default ui-corner-top ui-tabs-selected 
ui-state-active">
<a title="Customer" href="#customerDetails">
<span>Customer</span>
</a>
</li>
<li id="tab3" class="ui-state-default ui-corner-top">
<a title="Repair" href="#repairDetails">
<span>Repair</span>
</a>
</li>
<li id="tab4" class="ui-state-default ui-corner-top">
<a title="Shipping" href="#shippingDetails">
<span>Shipping</span>
</a>
</li>
</ul>

It would appear that none of the on... handlers get rendered in the final html.

Which struts2 version?
2.2.1

Which struts2-jquery plugin version?
3.1.1

Please provide any additional information below.

Original issue reported on code.google.com by roger.va...@googlemail.com on 22 Sep 2011 at 11:29

GoogleCodeExporter commented 9 years ago
I should have added that this is a tabbed panel with local divs. I'm not using 
remote divs.

Original comment by roger.va...@googlemail.com on 22 Sep 2011 at 12:45

GoogleCodeExporter commented 9 years ago

Original comment by johgep on 27 Sep 2011 at 7:47

GoogleCodeExporter commented 9 years ago
Having the exact same problem. Sounds like a simple fix by adding the on* 
handler to the anchor tag. This is a pretty serious bug for a project I'm 
working on. Any estimate on a fix we could download? Or, in the interim, any 
suggestions on how to bind an event handler to the anchor tag?

I cannot figure out how to do so using JQuery since this is dynamically 
created. So far, I've tried the following without any success in Firefox 6.0.2.

$("#panelTabs > ul").children( "li" ).delegate( "a", "click", function() { 
alert( "Here's some information." ); } );
$("#panelTabs > ul > li").delegate( "a", "click", function() { alert( "Here's 
some information." ); } );
$("#panelTabs > ul").children( "li" ).live( "a", "click", function() { alert( 
"Here's some information." ); } );

Original comment by texastai...@gmail.com on 30 Sep 2011 at 11:37