title: Primefaces & Radiobutton not updating Bean Value
body: <p>My goal is to use ajax in order to activate/deactivate menus based on the values of a radio button. 
  My problem is that the radio button with id="selectCategoryType" does not update the value in the Bean (catWordGuiBean.addCategoryType) - since I do not have a complex object but a string I do not need a custom converter. </p>
  
  <p>Here is my code: </p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:c="http://java.sun.com/jsp/jstl/core"
  xmlns:fn="http://java.sun.com/jsp/jstl/functions"
  xmlns:p="http://primefaces.org/ui" 
  &gt;
  &lt;h:head&gt;
      &lt;link rel="shortcut icon"
          href="http://localhost:8080/DeviceCommander/resources/images/favicon.ico" /&gt;
      &lt;title&gt;
          &lt;h:outputText value=" Pronounciator "/&gt;
      &lt;/title&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;p:layout fullPage="true"&gt;
  
          &lt;p:layoutUnit id="up" position="north" header="" resizable="true" closable="false" collapsible="true"&gt;
              &lt;h:form id="header"&gt;
                  &lt;p:panelGrid columns="6" layout="grid" cellspacing="20" styleClass="ui-noborder"&gt;
                      &lt;h:graphicImage value="resources/images/pronuncia.jpg" height="70" width="120" /&gt;
                      &lt;h:outputText value=" #{display.date}: " /&gt; 
                      &lt;h:outputText id="now" value="#{timeBean.now}" /&gt;   
                      &lt;p:poll interval="1" listener="#{timeBean.updateDate}" update="now" /&gt;
                      &lt;h:outputText value=" #{display.theme}: " /&gt;
                      &lt;p:themeSwitcher effectSpeed="normal" effect="fade" style="width:165px" id="defaultSwitcher" value="#{themeSwitcherBean.theme}"&gt;
                          &lt;f:selectItem itemLabel=" #{display.select} #{display.theme} " itemValue="" /&gt;
                          &lt;f:selectItems value=" #{themeSwitcherBean.themes} " /&gt;
                          &lt;p:ajax global="false" listener="#{themeSwitcherBean.saveTheme}" /&gt;
                      &lt;/p:themeSwitcher&gt;
                  &lt;/p:panelGrid&gt;
              &lt;/h:form&gt;   
          &lt;/p:layoutUnit&gt;
          &lt;p:layoutUnit position="center"&gt;
              &lt;p:panelGrid styleClass="ui-noborder"&gt;
                  &lt;p:row&gt;
                      &lt;p:column colspan="1"&gt;
                          &lt;p:panelGrid&gt;
                              &lt;h:form id="db"&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column colspan="4"&gt;
                                          &lt;h3&gt;
                                              &lt;h:outputText value=" ADD: " /&gt;
                                          &lt;/h3&gt;
                                      &lt;/p:column&gt;             
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;h:outputText for="selectCategoryType" value=" Category: " /&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column colspan="3"&gt;
                                          &lt;p:selectOneRadio id="selectCategoryType" value="#{catWordGuiBean.addCategoryType}" &gt;
                                              &lt;p:ajax event="click" update="addOldCategory" listener="#{catWordGuiBean.handleCategorySelection}" /&gt;
                                              &lt;f:selectItems value="#{catWordGuiBean.addCategoryTypes}" var="addCategoryType" itemLabel="#{addCategoryType}" itemValue="#{addCategoryType}"/&gt;
                                          &lt;/p:selectOneRadio&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;h:outputText value=" Old Category: " /&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column colspan="3"&gt;
                                          &lt;p:selectOneMenu id="addOldCategory" value="" disabled="#{catWordGuiBean.disabledOldCategoryGui}"&gt;
                                              &lt;f:selectItem itemLabel="Select One" itemValue="" /&gt;
                                              &lt;f:selectItem itemLabel="AH" itemValue="AH" /&gt;
                                              &lt;f:selectItem itemLabel="UH" itemValue="UH" /&gt;
                                          &lt;/p:selectOneMenu&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;h:outputText value=" New Category: " /&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column&gt;
                                          &lt;p:inputTextarea id="addNewCategoryName" rows="1" cols="4" maxlength="4" autoResize="false" value="#{catWordGuiBean.newCategoryName}" disabled="#{catWordGuiBean.disabledNewCategoryGui}"/&gt;
                                      &lt;/p:column&gt;
                                       &lt;p:column&gt;
                                          &lt;h:outputText value=" IPA: "/&gt; 
                                      &lt;/p:column&gt;
                                      &lt;p:column&gt;
                                          &lt;p:inputTextarea id="addNewIpa" rows="1" cols="3" maxlength="3" autoResize="false" value="#{catWordGuiBean.newIpa}" disabled="#{catWordGuiBean.disabledNewCategoryGui}"/&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;                                 
                                      &lt;p:column&gt;
                                          &lt;h:outputText value=" Word: "/&gt; 
                                      &lt;/p:column&gt;
                                      &lt;p:column colspan="3"&gt;
                                          &lt;p:inputText id="addNewWord"/&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;h:outputText value=" Submit: "/&gt; 
                                      &lt;/p:column&gt;
                                      &lt;p:column colspan="3"&gt;
                                          &lt;p:commandButton id="addCategoryAndWord" value="Add" /&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column colspan="4"&gt;
                                          &lt;h3&gt;
                                              &lt;h:outputText value=" DELETE: "/&gt;
                                          &lt;/h3&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;h:outputText value=" Category: "/&gt; 
                                      &lt;/p:column&gt;
                                      &lt;p:column colspan="2"&gt;
                                          &lt;p:selectOneMenu id="deleteOldCategory" value="" &gt;
                                              &lt;f:selectItem itemLabel="Select One" itemValue="" /&gt;
                                              &lt;f:selectItem itemLabel="AH" itemValue="AH" /&gt;
                                              &lt;f:selectItem itemLabel="UH" itemValue="UH" /&gt;
                                          &lt;/p:selectOneMenu&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column&gt;
                                          &lt;p:commandButton id="deleteCategory" value="Delete" /&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;h:outputText value=" Word: "/&gt; 
                                      &lt;/p:column&gt;
                                      &lt;p:column colspan="2"&gt;
                                          &lt;p:selectOneMenu id="deleteOldWord" value="" &gt;
                                              &lt;f:selectItem itemLabel="Select One" itemValue="" /&gt;
                                              &lt;f:selectItem itemLabel="AH" itemValue="AH" /&gt;
                                              &lt;f:selectItem itemLabel="UH" itemValue="UH" /&gt;
                                          &lt;/p:selectOneMenu&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column&gt;
                                          &lt;p:commandButton id="deleteWord" value="Delete" /&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                              &lt;/h:form&gt;   
                          &lt;/p:panelGrid&gt;
                      &lt;/p:column&gt;
                      &lt;p:column colspan="4"&gt;
                          &lt;p:panelGrid&gt;
                              &lt;h:form id="randomizer"&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;                                      
                                          &lt;h3&gt;
                                              &lt;h:outputText value=" Select Categories: "/&gt;
                                          &lt;/h3&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column colspan="2"&gt;
                                          &lt;p:selectOneMenu id="selectWordCategories" value="" &gt;
                                              &lt;f:selectItem itemLabel="Select" itemValue="" /&gt;
                                              &lt;f:selectItem itemLabel="AH" itemValue="Xbox One" /&gt;
                                              &lt;f:selectItem itemLabel="UH" itemValue="PS4" /&gt;
                                          &lt;/p:selectOneMenu&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;p:commandButton id="wordGenerator" value="Generate Word" /&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column&gt;
                                          &lt;p:commandButton id="categoryFinder" value="Show Word Category" /&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column&gt;
                                          &lt;h3&gt;
                                              &lt;h:outputText value=" Show Category in: "/&gt;
                                          &lt;/h3&gt;
                                          &lt;p:knob value="{wordRandomizerBean.seconds}"&gt;  
                                              &lt;p:ajax listener="#{wordRandomizerBean.knobChange}"/&gt;  
                                          &lt;/p:knob&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;h1&gt;
                                              &lt;h:outputText value=" Word: "/&gt; 
                                          &lt;/h1&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column colspan="2"&gt;
                                          &lt;h1&gt;
                                              &lt;h:outputText value=" #{wordRandomizerBean.randomWord} "/&gt; 
                                          &lt;/h1&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                                  &lt;p:row&gt;
                                      &lt;p:column&gt;
                                          &lt;h1&gt;
                                              &lt;h:outputText value=" Category: "/&gt; 
                                          &lt;/h1&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column&gt;
                                          &lt;h1&gt;
                                              &lt;h:outputText value=" IPA: "/&gt; 
                                          &lt;/h1&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column&gt;
                                          &lt;h1&gt;
                                              &lt;h:outputText value=" Category: "/&gt; 
                                          &lt;/h1&gt;
                                      &lt;/p:column&gt;
                                  &lt;/p:row&gt;
                              &lt;/h:form&gt;   
                          &lt;/p:panelGrid&gt;                              
                      &lt;/p:column&gt;
                  &lt;/p:row&gt;
              &lt;/p:panelGrid&gt;      
          &lt;/p:layoutUnit&gt;
      &lt;/p:layout&gt;
  &lt;/h:body&gt;
  </code></pre>
  
  <p></p>
  
  <p>And the Bean: </p>
  
  <pre><code>package com.linknet.beans;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import javax.annotation.PostConstruct;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.ViewScoped;
  
  import javax.faces.event.AjaxBehaviorEvent;
  
  @ManagedBean(name = "catWordGuiBean")
  @ViewScoped
  public class CategoryWordManagementBean {
      public CategoryWordManagementBean() {
          this.disabledNewCategoryGui = true;
          this.disabledOldCategoryGui = true;
          this.addCategoryType = "";
      }
      @PostConstruct
      public void init() {
          addCategoryTypes = new ArrayList&lt;String&gt;();
          addCategoryTypes.add("New");
          addCategoryTypes.add("Old");
      }
  
  
      public void enableNewCategory() {
          this.disabledNewCategoryGui = false;
      }
      public void disableNewCategory() {
          this.disabledNewCategoryGui = true;
      }
      public void enableOldCategory() {
          this.disabledOldCategoryGui = false;
      }
      public void disableOldCategory() {
          this.disabledOldCategoryGui = true;
      }
      public void handleCategorySelection(AjaxBehaviorEvent  e) {
          System.out.println("Test 1");
          System.out.println(addCategoryType);
      }
  
  
      public boolean isDisabledNewCategoryGui() {
          return this.disabledNewCategoryGui;
      }
      public void setDisabledNewCategoryGui(boolean disabledNewCategoryGui) {
          this.disabledNewCategoryGui = disabledNewCategoryGui;
      }
      public boolean isDisabledOldCategoryGui() {
          return disabledOldCategoryGui;
      }
      public void setDisabledOldCategoryGui(boolean disabledOldCategoryGui) {
          this.disabledOldCategoryGui = disabledOldCategoryGui;
      }
      public String getAddCategoryType() {
          return addCategoryType;
      }
      public void setAddCategoryType(String addCategoryType) {
          this.addCategoryType = addCategoryType;
      }
  
      public String getNewCategoryName() {
          return newCategoryName;
      }
      public void setNewCategoryName(String newCategoryName) {
          this.newCategoryName = newCategoryName;
      }
      public String getNewIpa() {
          return newIpa;
      }
      public void setNewIpa(String newIpa) {
          this.newIpa = newIpa;
      }
      private boolean disabledNewCategoryGui;
      private boolean disabledOldCategoryGui;
  
      private List&lt;String&gt; addCategoryTypes;  
      public List&lt;String&gt; getAddCategoryTypes() {
          return addCategoryTypes;
      }
      public void setAddCategoryTypes(List&lt;String&gt; addCategoryTypes) {
          this.addCategoryTypes = addCategoryTypes;
      }
      private String addCategoryType;
      private String newCategoryName;
      private String newIpa;
  }
  </code></pre>
  
  <p>Where is my mistake? </p>
  
  <p>I appreciate any help, thanks in advance. </p>