title: I can not do my work Event - JSF - exception say Property 'sorteiaBotao' not found on type BotaoBean
body: <p>This is my code: botoes.xhtml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &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"&gt;
  
  &lt;h:head&gt;
      &lt;title&gt;K19 - Eventos&lt;/title&gt;
  &lt;/h:head&gt;
  
  &lt;h:body&gt;
      &lt;h:form&gt;
          &lt;h:commandButton id="botao-jonas" value="Jonas" disabled="false" actionListener="#{BotaoBean.sorteiaBotao}" /&gt;
          &lt;h:commandButton id="botao-marcelo" value="Marcelo" disabled="true" actionListener="#{BotaoBean.sorteiaBotao}" /&gt;
          &lt;h:commandButton id="botao-rafael" value="Rafael" disabled="true" actionListener="#{BotaoBean.sorteiaBotao}" /&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and BotaoBean.java:</p>
  
  <pre><code>import javax.faces.bean.ManagedBean;
  import javax.faces.component.*;
  import javax.faces.event.ActionEvent;
  
  
  @ManagedBean(name="BotaoBean")
  public class BotaoBean {
  
      public void sorteiaBotao(ActionEvent event) {
          UIComponent formulario = event.getComponent().getParent();
  
          UIComponent botaoJonas = formulario.findComponent("botao-jonas");
          UIComponent botaoMarcelo = formulario.findComponent("botao-marcelo");
          UIComponent botaoRafael = formulario.findComponent("botao-rafael");
  
          botaoJonas.getAttributes().put("disabled",true);
          botaoMarcelo.getAttributes().put("disabled",true);
          botaoRafael.getAttributes().put("disabled",true);
  
          double numero = Math.random();
  
          if (numero&lt;1.0/3.0) {
              botaoJonas.getAttributes().put("disabled",false);
          } else if (numero&lt;2.0/3.0) {
              botaoMarcelo.getAttributes().put("disabled",false);
          } else {
              botaoRafael.getAttributes().put("disabled",false);
          }
      }    
  }
  </code></pre>
  
  <p>I run and gives the following exception:</p>
  
  <blockquote>
    <p>javax.servlet.ServletException: /botoes.xhtml: Property 'sorteiaBotao'
    not found on type BotaoBean
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)</p>
  </blockquote>
  
  <p>I don't know how to solve. I did the same as tutorial example. Can anyone help me?</p>
  
  <p>Thanks!</p>