[richfaces-issues] [JBoss JIRA] Created: (RF-7676) Actions for h:commandButton in tabPanel with dynamic selectedTab and switchType of ajax or server not being called

Dean Ashby (JIRA) jira-events at lists.jboss.org
Sun Aug 9 20:22:29 EDT 2009


Actions for h:commandButton in tabPanel with dynamic selectedTab and switchType of ajax or server not being called
------------------------------------------------------------------------------------------------------------------

                 Key: RF-7676
                 URL: https://jira.jboss.org/jira/browse/RF-7676
             Project: RichFaces
          Issue Type: Bug
          Components: component-panels-layout-themes
    Affects Versions: 3.3.0
         Environment: Richfaces 3.3.0GA on Tomcat 6.0.18
            Reporter: Dean Ashby


In the example below, the h:commandButton action only works on the tab that was selected when the page containing the panel was opened.  

        <rich:tabPanel id="panel" selectedTab="#{test.selectedTab}" switchType="server">
          <rich:tab id="taba" label="Tab A" name="taba" >
            <h:commandButton id="add_itemA" value="Add" action="#{test.actionAddTestA}" />          
          </rich:tab>
          <rich:tab id="tabb" label="Tab B" name="tabb" >            
            <h:commandButton id="add_itemB" value="Add" action="#{test.actionAddTestB}" />          
          </rich:tab>
          <rich:tab id="tabc" label="Tab C" name="tabc" >            
            <h:commandButton id="add_itemC" value="Add" action="#{test.actionAddTestB}" />          
          </rich:tab>
        </rich:tabPanel>

If the selectedTab attribute is hardwired to 'taba' for example, the actions on all three tabs work fine.  Similarly if the switchType is set to 'client' then all three actions work fine.

I've come across a couple of posts that talk about actions not being called if the parent component isn't being rendered.  I'm guessing that the selectedTab value is being re-read when the view is reconstructed prior to trying to execute the action.  Because the selectedTab value is still set to the same value as when the page was loaded, the components on whichever of the other two tabs was selected are not being reconstructed and so therefore the corresponding action can't be called. 

A similar problem occurs when and extended data table is rendered in each of the tabs.  The table columns can only be sorted  on the table in the tab that was originally selected.  If you switch to a different tab and then try changing the sort order of one of the table columns a request is sent to the server and returns an HTTP 200 response but the 'hourglass' icon remains spinning, and the table order remains unchanged.




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list