From jira-events at lists.jboss.org Mon Jul 30 19:30:07 2012 Content-Type: multipart/mixed; boundary="===============6017293760095047070==" MIME-Version: 1.0 From: Andrey Zhemoytuk (JIRA) To: richfaces-issues at lists.jboss.org Subject: [richfaces-issues] [JBoss JIRA] (RF-12225) rich:tabPanel first tab issue Date: Mon, 30 Jul 2012 19:30:07 -0400 Message-ID: <1541001724.24632.1343691007569.JavaMail.tomcat@jira02.app.mwc.hst.phx2.redhat.com> In-Reply-To: 1190294031.47858.1335953117942.JavaMail.tomcat@jira02.app.mwc.hst.phx2.redhat.com --===============6017293760095047070== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable [ https://issues.jboss.org/browse/RF-12225?page=3Dcom.atlassian.jira.pl= ugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D12708792#com= ment-12708792 ] = Andrey Zhemoytuk commented on RF-12225: --------------------------------------- The issue is the case for active tab and tabs with client side switching (i= nitialization logic is executed twice, as a result e.g. duplicate event han= dlers are bind to elements). It seems fix is as simple as changing next line in org.richfaces.renderkit.= html.TabPanelRenderer#doEncodeEnd So TabPanelRenderer writes JavaScript block only for that tabs for which it= was not done in TabRenderer: renderer.writeJavaScript(writer, context, tab); to: if (!tab.shouldProcess()) { renderer.writeJavaScript(writer, context, tab); } = > rich:tabPanel first tab issue > ----------------------------- > > Key: RF-12225 > URL: https://issues.jboss.org/browse/RF-12225 > Project: RichFaces > Issue Type: Bug > Security Level: Public(Everyone can see) = > Components: component-output > Affects Versions: 4.2.1.Final > Environment: Tomcat 7, JSF 2.2, RF 4.2.1.FINAL > Reporter: Philip Maes > Fix For: 4.Future > > > Hello, > there is a weird behavior with rich:tabPanel. And the bug (for me it's a = bug) is present in your showcase. > When you first load a page that contains a tabPanel, the first tab has a = nested js script for the toggle. The problem is that this js script is also= present at its normal position (after tab declaration). And it causes that= when you click on this tab, 2 ajax requests are sent. But only once. After= , the nested js script isn't present anymore. > {code:title=3D|borderStyle=3Dsolid} >
>
Here is tab= #1
> > >
>
>
> > > {code} > Steps to reproduce it: > -go to: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo= =3DtabPanel&sample=3DvalueManagement&skin=3DblueSky > -open a js console (for me it's firebug, console tab) to see ajax request= s; > -use html inspector to check that in the body of tab "First" you have the= js script; > -click on tab named "Second"; > -then click on tab named "First" and there are 2 ajax requests sent; > -now reclick on another tab; > -then click on tab named "First" and there is only 1 ajax request sent; > -recheck the content of the tab and you can see that the js script isn't = present anymore. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.jboss.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira =20 --===============6017293760095047070==--