jquery - jsf listener on fullcalendar -


i want use fullcalendar jquery plugin jsf.

but how can add f:ajax listener e.g. eventclick of fullcalendar?

here's code want add listener to:

<ui:define name="content">     <div id="calendar">     <f:ajax event="eventclick" listener="#{schedulecontroller.ondateselect}"/>     </div> </ui:define>  <ui:define name="jsfiles">     <script>         $(document).ready(function() {              var calendar = $('#calendar').fullcalendar({                 header : {                     left : 'prev,next today',                     center : 'title',                     right : 'month,agendaweek,agendaday'                 },                 selectable : true,                 selecthelper : true,                 select : function(start, end, allday) {                     var title = prompt('event title:');                     if (title) {                         calendar.fullcalendar('renderevent', {                             title : title,                             start : start,                             end : end,                             allday : allday                         }, true // make event "stick"                         );                     }                     calendar.fullcalendar('unselect');                 },                 editable : true,                 eventclick : function(event, element) {                     event.title = "clicked!";                     $('#calendar').fullcalendar('updateevent', event);                 }             });          });     </script> </ui:define> 

i'm afraid can't directly. can example add hidden button, connect ajax listener it, , click button javascript. can try send ajax using client side jsf api.

the first method easier - see here more details.

one more possibility try out a4j library use <a4j:jsfunction> tag.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -