Actually my code so far for this page is pretty simple so I'll just post 
that.

First - calendar event someone clicked on.

<!-- calendar month view -->
    <event-handler name="percalendar" type="generalSecuredEvent">
        <broadcasts>
<message name="getSavedJobs" />
<message name="getSavedSearches" />
        </broadcasts>
        <results>
        </results>
        <views>
         <include name="main" template="mem/calmonth.cfm" />
        </views>
    </event-handler>
    <!-- /calendar month view -->

This gets some misc stuff not related to calendar itself and displays 
template "mem/calmonth.cfm".

Inside "mem/calmonth.cfm" is the following javascript:

    // page is now ready, initialize the calendar...

    $('#calendarJQ').fullCalendar({
        // put your options and callbacks here
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: [
        {
            title: 'Event1',
            start: '2012-08-04'
        },
        {
            title: 'Event2',
            start: '2012-08-05'
        }
        // etc...
    ],
    color: 'yellow',   // an option!
    textColor: 'black', // an option!
eventSources: [
{
url:'index.cfm?event=percalendardata'
}
]
    })
});

Notice it has two hard-wired events for testing and a link 
to index.cfm?event=percalendardata to get "real" data.  

This event looks like - 

<!-- calendar data -->
    <event-handler name="percalendardata">
        <broadcasts>
<message name="getEvents" />
        </broadcasts>
        <results>
        </results>
        <views>
         <include name="main" template="mem/jsondata.cfm" />
        </views>
    </event-handler>
    <!-- /calendar data -->

which works flawlessly EXCEPT it's not getting the start/end vars passed by 
fullcalendar javascript above.

So... my controller looks like:

<cffunction name="getEvents" access="remote" output="false" 
returntype="Any" returnformat="JSON">
<cfargument name="event" type="any" />
<cfset var localvar = structNew() />
    <cfset localvar.memberSID = beans.loginSessionManager.loadSID() />
    <cfset localvar.startdate = arguments.event.getValue("start") /><!--- 
from fullcalendar --->
        <cfset localvar.enddate = arguments.event.getValue("end") /><!--- 
from fullcalendar --->
<!---<cfoutput><cfdump var=#arguments.event.getValue("start")#><br><cfdump 
var=#url#></cfoutput><cfabort>--->
      <!--- get our date range's activity --->
<cfset localvar.json_qryResults = beans.calModel.getCalActivityJSON( 
memberSID = localvar.memberSID,
activityCalStart = 1343851691,
activityCalEnd = 1346530126 ) />
<cfset arguments.event.setValue("json_qryResults", 
localvar.json_qryResults) />
</cffunction>

which works because I hard-wired in two date values for  
activityCalStart and end.  That returns valid json via "mem/jsondata.cfm" 
and the calendar displays it.  All is good.... EXCEPT 
that arguments.event.getValue("start") and end are blank in this cffumction 
so nothing is retrieved if I use them.  If I go to the top page 
(percalendar) ina  browser and then grab getValue("start") in 
onrequeststart when I fire the change state methods for the calendar itself 
(without changing the "outer" page holding the calendar, i.e. percalendar) 
the event vars of start and end have proper values.  By the time they get 
to the controller however, they're gone.  Does this make sense? 

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to