title: Set managedBean attribute by jQuery function
body: <p>I am developing a project where I integrate JQuery plugin FullCalendar with a JSF application. I would like to set the calEvent.start value for ManagedBean within the JQuery eventClick function: function (calEvent, jsEvent view). However, the value passed within the jQuery function is received as empty by ManagedBean, since I'm printando the same on the GlassFish log. What happens? Here is the template page code:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&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://xmlns.jcp.org/jsf/facelets"
    xmlns:h="http://xmlns.jcp.org/jsf/html"&gt;
  
      &lt;h:head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
          &lt;h:outputStylesheet name="./css/default.css"/&gt;
          &lt;h:outputStylesheet name="./css/cssLayout.css"/&gt;
          &lt;h:outputScript  name="jquery.min.js" library="js"/&gt; 
          &lt;h:outputScript  name="moment.min.js" library="js"/&gt;
          &lt;h:outputScript  name="fullcalendar.min.js" library="js"/&gt; 
          &lt;h:outputScript  name="lang-all.js" library="js"/&gt; 
          &lt;h:outputScript name="fullcalendar.print.css" library="css"/&gt;
          &lt;h:outputScript name="fullcalendar.css" library="css"/&gt;
  
  
          &lt;h:outputStylesheet name="fullcalendar.css" library="css"  /&gt; 
          &lt;script type="text/javascript"&gt;
              var myvalue = null;
  
              $(document).ready(function () {
  
                  $('#calendar').fullCalendar({
                      header: {
                          left: 'prev,next today',
                          center: 'title',
                          right: ''
                      },
                      defaultView: 'agendaDay',
                      selectable: true,
                      selectHelper: true,
                      select: function (start, end) {
                          var title = prompt('Motivo da consulta:');
                          var eventData;
                          if (title) {
                              eventData = {
                                  title: title,
                                  start: start,
                                  end: end
                              };
  
                              $('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true
  
                              $('.motivo').val(eventData.title);
  
                              $('.horaInicio').val(eventData.start);
  
                              $('.horaTermino').val(eventData.end);
                              $('.dataSelecionada').val(eventData.start.format());
  
  
                          }
                          $('#calendar').fullCalendar('unselect');
                      },
                      lang: 'pt',
                      editable: true,
                      eventLimit: true, // allow "more" link when too many events
                      events: #{agendamentoManagedBean.jsonArray}
  
  
                      eventClick: function (calEvent, jsEvent, view) {
  
                          // alert('Event: ' + calEvent.title +' Data '+calEvent.start);
  
              #{agendamentoManagedBean.testeClicaEvento(calEvent.start)}
                      }
  
                  });
  
  
               });
  
  
          &lt;/script&gt;
          &lt;script type="text/css"&gt;
  
              .body {
                  margin: 40px 10px !important;
                  padding: 0 !important;
  
  
                  //font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif !important;
                  font-size: 12px !important;
              }
  
              #calendar {
                  max-width: 900px !important;
                  margin: 0 auto !important;
               }
  
          &lt;/script&gt;
  
          &lt;title&gt;Facelets Template&lt;/title&gt;
  
      &lt;/h:head&gt;
  
      &lt;h:body&gt;
  
          &lt;div id="top"&gt;
              &lt;ui:insert name="top"&gt;Top&lt;/ui:insert&gt;
          &lt;/div&gt;
  
          &lt;div id="content" class="center_content"&gt;
              &lt;ui:insert name="content"&gt;Content&lt;/ui:insert&gt;
          &lt;/div&gt;
  
          &lt;div id="bottom"&gt;
              &lt;ui:insert name="bottom"&gt;Bottom&lt;/ui:insert&gt;
          &lt;/div&gt;
  
      &lt;/h:body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Below is part of ManagedBean code:</p>
  
  <pre><code>@ManagedBean(name = "agendamentoManagedBean")
  @SessionScoped
  public class AgendamentoManagedBean {
  
  
  
      public void testeClicaEvento(String str) {
          Logger logger = Logger.getAnonymousLogger();
          logger.info("*********DATA EVENTO SELECIONADO *****" + str);
  
      }
  
  }
  </code></pre>