Sorry...probably do need to be more specific.  It was late last night and I
was already frustrated with it...

Lots of parameters == items that need to be specific to the page being
rendered at the time rather than common to all components of type
freecalendar.  For example, each page will probably need a different event
source.  A person may want to arrange the header on the calendar
differently on different pages.  Different colors could be requested for
different types of events.  There's a myriad of options available.

Trouble is, a lot of this needs to be set up during the afterRender portion
of the component.  That basically removes the hard coding option.  I have
been passing them in afterRender, and I'll need to keep doing that I'm
sure.  My problem is that for each bit that is specific to the instance of
fullcalendar for that page (lets say event source for the sake of the
argument), I need to pass that information from the page to the component
so it can be included in the afterRender function.

So that's really my question in a nutshell...how do I get my parameters
passed to the component when I am not instantiating the component?

On Mon, Aug 20, 2012 at 8:17 AM, Ray Nicholus <rnicho...@widen.com> wrote:

> What is the problem with passing "a lot" of parameters into your javascript
> in afterRender()?  Maybe I'm just not sure what your specific question is.
>  You have several ways to pick up such values in your javascript, such as:
>
>
>    1. Pass them in afterRender using JavascriptSupport.
>    2. Hardcode them in your js
>    3. Make use of data attributes on associated elements, and reference
>    these values using jQuery's data function
>
>
>
> On Sun, Aug 19, 2012 at 9:59 PM, ccureau <cmcur...@gmail.com> wrote:
>
> > I have created a new component based on freecalendar and inserted it into
> > the
> > tapestry5-jquery tree.  For those who work with that project, it is
> > implemented in much the same way as the google calendar component.  I'm
> > happy with my progress, but I need to pass a lot of parameters to the
> > javascript code with the AfterRender parameter.
> >
> > I'm thinking that I need to either make the component into an abstract
> > class
> > or do some other magic to pass variables such as calendar event location
> > URL, headers, and whatever else needed for the initial rendering.  I'm
> just
> > not sure at this point how to do that.
> >
> > If anyone has some suggestions, I'd be quite happy to hear them.
> >
> > Thanks!
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tapestry.1045711.n5.nabble.com/javascript-component-questions-tp5715582.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>

Reply via email to