[richfaces-issues] [JBoss JIRA] (RF-12225) rich:tabPanel first tab issue

Philip Maes (JIRA) jira-events at lists.jboss.org
Wed May 2 06:07:18 EDT 2012


     [ https://issues.jboss.org/browse/RF-12225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Philip Maes updated RF-12225:
-----------------------------

    Description: 
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=|borderStyle=solid}
<div id="j_idt2821:j_idt2827" class="rf-tab">
<div id="j_idt2821:j_idt2827:content" class="rf-tab-cnt"> Here is tab #1 </div>
    <!-- anormal js script -->
    <script type="text/javascript">
        new RichFaces.ui.Tab("j_idt2821:j_idt2827", "index":0,"leave":null,"togglePanelId":"j_idt2821:tp","switchMode":"ajax","name":"j_idt2827","enter":null,"disabled":false} )
    </script>
</div>
<div id="j_idt2821:j_idt2829" style="display:none;"></div>
<div id="j_idt2821:j_idt2831" style="display:none;"></div>
<!-- normal place -->
<script type="text/javascript">
new RichFaces.ui.Tab("j_idt2821:j_idt2827",{"index":0,"leave":null,"togglePanelId":"j_idt2821:tp","switchMode":"ajax","name":"j_idt2827","enter":null,"disabled":false} )
</script>
{code}

Steps to reproduce it:
-go to: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=tabPanel&sample=valueManagement&skin=blueSky
-open a js console (for me it's firebug, console tab) to see ajax requests;
-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.


  was:
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=Bar.java|borderStyle=solid}
<div id="j_idt2821:j_idt2827" class="rf-tab">
<div id="j_idt2821:j_idt2827:content" class="rf-tab-cnt"> Here is tab #1 </div>
    <!-- anormal js script -->
    <script type="text/javascript">
        new RichFaces.ui.Tab("j_idt2821:j_idt2827", "index":0,"leave":null,"togglePanelId":"j_idt2821:tp","switchMode":"ajax","name":"j_idt2827","enter":null,"disabled":false} )
    </script>
</div>
<div id="j_idt2821:j_idt2829" style="display:none;"></div>
<div id="j_idt2821:j_idt2831" style="display:none;"></div>
<!-- normal place -->
<script type="text/javascript">
new RichFaces.ui.Tab("j_idt2821:j_idt2827",{"index":0,"leave":null,"togglePanelId":"j_idt2821:tp","switchMode":"ajax","name":"j_idt2827","enter":null,"disabled":false} )
</script>
{code}

Steps to reproduce it:
-go to: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=tabPanel&sample=valueManagement&skin=blueSky
-open a js console (for me it's firebug, console tab) to see ajax requests;
-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.



    
> 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
>
> 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=|borderStyle=solid}
> <div id="j_idt2821:j_idt2827" class="rf-tab">
> <div id="j_idt2821:j_idt2827:content" class="rf-tab-cnt"> Here is tab #1 </div>
>     <!-- anormal js script -->
>     <script type="text/javascript">
>         new RichFaces.ui.Tab("j_idt2821:j_idt2827", "index":0,"leave":null,"togglePanelId":"j_idt2821:tp","switchMode":"ajax","name":"j_idt2827","enter":null,"disabled":false} )
>     </script>
> </div>
> <div id="j_idt2821:j_idt2829" style="display:none;"></div>
> <div id="j_idt2821:j_idt2831" style="display:none;"></div>
> <!-- normal place -->
> <script type="text/javascript">
> new RichFaces.ui.Tab("j_idt2821:j_idt2827",{"index":0,"leave":null,"togglePanelId":"j_idt2821:tp","switchMode":"ajax","name":"j_idt2827","enter":null,"disabled":false} )
> </script>
> {code}
> Steps to reproduce it:
> -go to: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=tabPanel&sample=valueManagement&skin=blueSky
> -open a js console (for me it's firebug, console tab) to see ajax requests;
> -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 administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list