[richfaces-issues] [JBoss JIRA] Created: (RF-10327) tabPanel: can't change activeItem from outside the panel

Ilya Shaikovsky (JIRA) jira-events at lists.jboss.org
Wed Jan 26 15:56:49 EST 2011


tabPanel: can't change activeItem from outside the panel
--------------------------------------------------------

                 Key: RF-10327
                 URL: https://issues.jboss.org/browse/RF-10327
             Project: RichFaces
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: component-panels-layout-themes
    Affects Versions: 4.0.0.Milestone5
            Reporter: Ilya Shaikovsky
            Assignee: Nick Belaevski


Using the code below panel always "one step behind" the select. chaning first time - nothing, second time - first selection set and so on.. no js errors and nothing in log.

Can't update the parent because of RF-10112

	<h:form>
		<a4j:region>
		<rich:panel style="width:500px">
			<h:selectOneRadio value="#{cityTabBean.city}"
				valueChangeListener="#{cityTabBean.changeCity}">
				<f:selectItem itemLabel="New York" itemValue="nyc" />
				<f:selectItem itemLabel="San Francisco" itemValue="sf" />
				<f:selectItem itemLabel="Los Angeles" itemValue="la" />
				<a4j:ajax event="change" render="cityTabs @this" />
			</h:selectOneRadio>
		</rich:panel>
		</a4j:region>
		<rich:panel style="width:500px" header="rich:tabPanel and rich:tab">
			<rich:tabPanel switchType="ajax" id="cityTabs"
				activeItem="#{cityTabBean.selectedTab}">
				<rich:tab header="New York City" name="nyc">
                  Statue of Liberty
              </rich:tab>
				<rich:tab header="San Francisco" name="sf">
                  Golden Gate Bridge
              </rich:tab> 
				<rich:tab header="Los Angeles" name="la">
                  Hollywood
              </rich:tab>
			</rich:tabPanel> 
		</rich:panel>
	</h:form>

and 

package org.richfaces.book.examples.tabpanel;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ValueChangeEvent;

@ManagedBean
@SessionScoped
public class CityTabBean {

    private String city = "sf";

    private String selectedTab = "sf";

    public void changeCity(ValueChangeEvent event) {
        System.out.println("CityTabBean.changeCity()");
        System.out.println(event.getNewValue());
        selectedTab = city;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getSelectedTab() {
        return selectedTab;
    }

    public void setSelectedTab(String selectedTab) {
        this.selectedTab = selectedTab;
    }
}


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list