[richfaces-issues] [JBoss JIRA] (RF-10989) Reimplement AbstractPanel.getActiveItem() more defensively

Jean ANDRE (Issue Comment Edited) (JIRA) jira-events at lists.jboss.org
Fri Nov 18 10:59:42 EST 2011


    [ https://issues.jboss.org/browse/RF-10989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643993#comment-12643993 ] 

Jean ANDRE edited comment on RF-10989 at 11/18/11 10:59 AM:
------------------------------------------------------------

There is some strange behavior with this method. There is also a NPE when you had tab even if you set the activeItem attribute (bind to :  activeItem="#{desktopTabController.activeTab}"). It is a veritable nightmare ! The behavior of the tab seems to be different when you enclose or not tab inside an outputPanel.
When we remove the outputPanel, there no NPE but the tab does not refresh well when we close a tab. In both case, we are in trouble !

<h:form id="tabbedForm">
   <rich:tabPanel id="desktopTabPanel" switchType="ajax" headerPosition="top" headerLocation="center" activeItem="#{desktopTabController.activeTab}">
   <rich:tab id="tab-workitems" name="tab-workitems" header="#{msg['desktop.tab.workitems']}">
   <!--                -->
   <!--  WORKITEMS TAB -->
   <!--                -->
   </rich:tab>
   <c:forEach items="#{desktopTabController.desktopTabBean.tabElements}" var="tab">
      <a4j:outputPanel>
         <rich:tab id="#{tab.id}" name="#{tab.id}" >
         <!--                -->
	 <!--  DYNAMIC TABS  -->
	 <!--                -->
	 <f:facet name="header">
	    <h:panelGrid columns="2">
	       <h:outputText value="#{tab.id}" />
	          <h:graphicImage value="/images/closeButton.png"
		             styleClass="closeButton"
		                onclick="closeTab('#{tab.id}');" />
            </h:panelGrid>
	</f:facet>
	<ui:fragment rendered="#{tab.isTabClient}">
	   <!--               -->
	   <!--  CLIENT TAB   -->
	   <!--               -->
	<ui:include src="client/listClient.xhtml" />
	</ui:fragment>
	<ui:fragment rendered="#{tab.isTabWorkItems}">
	   <!--               -->
	   <!-- WORKITEMS TAB -->
	   <!--               -->
	   <ui:include src="workItems/listWorkItems.xhtml" />
	</ui:fragment>
      </rich:tab>
    </a4j:outputPanel>
  </c:forEach>
</rich:tabPanel>


                
      was (Author: jorelia64):
    There is some strange behavior with this method. There is also a NPE when you had tab even if you set the activeItem attribute (bind to :  activeItem="#{desktopTabController.activeTab}"). It is a veritable nightmare ! The behavior of the tab seems to be different when you enclose or not tab inside an outputPanel.
When we remove the outputPanel, there no NPE but the tab does not refresh well when we close a tab. In both case, we are in trouble !

{code}
<h:form id="tabbedForm">
   <rich:tabPanel id="desktopTabPanel" switchType="ajax" headerPosition="top" headerLocation="center" activeItem="#{desktopTabController.activeTab}">
   <rich:tab id="tab-workitems" name="tab-workitems" header="#{msg['desktop.tab.workitems']}">
   <!--                -->
   <!--  WORKITEMS TAB -->
   <!--                -->
   </rich:tab>
   <c:forEach items="#{desktopTabController.desktopTabBean.tabElements}" var="tab">
      <a4j:outputPanel>
         <rich:tab id="#{tab.id}" name="#{tab.id}" >
         <!--                -->
	 <!--  DYNAMIC TABS  -->
	 <!--                -->
	 <f:facet name="header">
	    <h:panelGrid columns="2">
	       <h:outputText value="#{tab.id}" />
	          <h:graphicImage value="/images/closeButton.png"
		             styleClass="closeButton"
		                onclick="closeTab('#{tab.id}');" />
            </h:panelGrid>
	</f:facet>
	<ui:fragment rendered="#{tab.isTabClient}">
	   <!--               -->
	   <!--  CLIENT TAB   -->
	   <!--               -->
	<ui:include src="client/listClient.xhtml" />
	</ui:fragment>
	<ui:fragment rendered="#{tab.isTabWorkItems}">
	   <!--               -->
	   <!-- WORKITEMS TAB -->
	   <!--               -->
	   <ui:include src="workItems/listWorkItems.xhtml" />
	</ui:fragment>
      </rich:tab>
    </a4j:outputPanel>
  </c:forEach>
</rich:tabPanel>
{code}

                  
> Reimplement AbstractPanel.getActiveItem() more defensively
> ----------------------------------------------------------
>
>                 Key: RF-10989
>                 URL: https://issues.jboss.org/browse/RF-10989
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-panels-layout-themes, optimization
>    Affects Versions: 4.0.0.Final
>            Reporter: Lukáš Fryč
>            Assignee: Lukáš Fryč
>            Priority: Trivial
>             Fix For: 4.2.0.Tracking
>
>
> Based on the discussions in RF-10951, it will be good to implement AbstractPanel.getActiveItem(), because it will fail each time you remove the active tab.

--
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