fluid-tech IRC Logs-2013-07-11
[11:09:13 CDT(-0500)] <nanook_> What's the preferred place to initialize variables in a fluid component?
[11:09:28 CDT(-0500)] <nanook_> I could use the Init functions, or the onCreate handler..
[11:10:17 CDT(-0500)] <colinclark> Bosmon: I'm on my way out for a few hours
[11:10:23 CDT(-0500)] <nanook_> The docs suggest minimizing the use of init functions.. and using Invokers as much as possible
[11:10:25 CDT(-0500)] <colinclark> can you help nanook_ when you get a chance?
[11:10:44 CDT(-0500)] <nanook_> hey colinclark Bosmon
[13:33:06 CDT(-0500)] <Bosmon> Hi nanook
[13:33:12 CDT(-0500)] <Bosmon> Or nanook_
[13:33:26 CDT(-0500)] <Bosmon> The recommended way of initializing variables is by use of the "members" directive
[13:34:27 CDT(-0500)] <nanook_> Hey Bosmon
[13:34:43 CDT(-0500)] <nanook_> Does that apply to public methods too?
[13:35:35 CDT(-0500)] <Bosmon> nanook_ - methods are created using the "invokers" block
[13:39:19 CDT(-0500)] <nanook_> Bosmon: could you point me to some example code? I've been looking at the inlineEdit component..
[13:39:41 CDT(-0500)] <nanook_> A lot of the initialization there seems to be happening in the onCreate handler
[13:40:00 CDT(-0500)] <Bosmon> nanook_ - yes, InlineEdit is a pretty good example now
[13:40:14 CDT(-0500)] <Bosmon> You can see that it has both "members" and "invokers" blocks
[13:40:22 CDT(-0500)] <Bosmon> Hopefully you are looking at the version in current trunk
[13:41:37 CDT(-0500)] <Bosmon> The majority happens in those blocks, although there are a few actions in "onCreate" too
[13:42:21 CDT(-0500)] <Bosmon> But yes, any initialisation that involves positive actions, linke tinkering with the DOM etc should generally happen in onCreate
[13:43:40 CDT(-0500)] <nanook_> Bosmon: so things like assigning click handlers should happen in onCreate?
[13:44:08 CDT(-0500)] <Bosmon> nanook_ currently, yes
[13:44:20 CDT(-0500)] <Bosmon> Right now we tend to do this directly with jQuery using "this" blocks
[13:44:31 CDT(-0500)] <Bosmon> But there will be an improved system once we implement the "new renderer"
[13:44:44 CDT(-0500)] <nanook_> ahhh.. cool.
[13:44:47 CDT(-0500)] <nanook_> thanks!
[13:48:50 CDT(-0500)] <Bosmon> nanook_ - this "demo component" has an example of what is the current style
[13:48:51 CDT(-0500)] <Bosmon> https://github.com/amb26/infusion/blob/56741cdfc3070de00b0adfe3c9f236a67f86ec95/src/webapp/demos/keyboard-a11y/js/five-star.js#L81-L152
[13:49:41 CDT(-0500)] <Bosmon> You can see that it binds several raw jQuery handlers in its "onCreate" block
[13:51:38 CDT(-0500)] <nanook_> oh neat! will this be in trunk anytime soon?
[13:53:58 CDT(-0500)] <Bosmon> nanook_ - hopefully it will be reviewed very soon!
[13:54:53 CDT(-0500)] <Bosmon> Probably when michelled gets back
[15:21:24 CDT(-0500)] <Michelle_> Hi, this is Michelle from the ISKME, working on the PGA prototype with Jess's team
[15:21:57 CDT(-0500)] <jessm> hi Michelle_
[15:22:07 CDT(-0500)] <jessm> welcome
[15:22:10 CDT(-0500)] <Michelle_> Hi Jess! Thanks
[15:22:18 CDT(-0500)] <Michelle_> I have a question about text to speech
[15:22:23 CDT(-0500)] <jessm> Michelle_: #fluid-work is the more general channel
[15:22:34 CDT(-0500)] <jessm> probably best to ask in there
[15:22:50 CDT(-0500)] <jessm> that's where "everyone" is
[15:22:57 CDT(-0500)] <Michelle_> sure
[15:23:03 CDT(-0500)] <Michelle_> I'll switch over