**** BEGIN LOGGING AT Mon Jan 14 02:59:59 2013 Jan 14 04:38:55 when you resize components is there a way to trigger the parent/container to resize/update? Jan 14 19:19:39 hey guys, can anyone explain to me how bubbling works in Enyo? I'm trying to use it, and it works for me in one case, but not in the other Jan 14 19:19:55 bubbleUp(' Jan 14 19:20:22 bubbleUp('somename', {object: someobject}); Jan 14 19:21:01 that's the same as using this.bubble, right? Jan 14 19:21:39 will send a event titled 'somename' to all of a member's parents starting with it's first parent, and anything with property 'somename' will call that function designated, passing the object in the 2nd parameter as the 1st param Jan 14 19:22:04 so if you had {kind: 'mykind', somename: 'catchit'} Jan 14 19:22:20 and catchit: function(inEvent) { } Jan 14 19:22:35 you can access that object by inEvent.object Jan 14 19:22:56 up the parent chain Jan 14 19:22:58 this.bubble starts with itself Jan 14 19:23:08 bubbleUp starts with the parent Jan 14 19:23:16 it won't hit other components at a the same level as the parent Jan 14 19:24:43 ok, well, in an ontap event for a div, I bubbled a variable from the div up w/ the eventname "onCall" Jan 14 19:25:26 in the grandparent div, I try to handle it Jan 14 19:25:32 using: Jan 14 19:25:42 handlers: { Jan 14 19:25:52 onCall: "trace" Jan 14 19:25:55 } Jan 14 19:26:06 but trace never gets called :( Jan 14 19:26:18 i don't think you should use handlers for bubble, i think you just do onCall: 'trace' Jan 14 19:26:34 I'm pretty sure handlers is right Jan 14 19:26:47 ok, that's probably a nicer way to do it then Jan 14 19:26:52 handlers is what it says to use in the docs Jan 14 19:27:10 GodGinrai: have you delcared the event in the events block? Jan 14 19:27:27 events block? Jan 14 19:27:47 oh wait, you may not need to if you're using bubble Jan 14 19:27:52 https://github.com/enyojs/enyo/wiki/Event-Handling Jan 14 19:28:08 events: { Jan 14 19:28:21 onCall: "" Jan 14 19:28:21 } Jan 14 19:28:45 but the doc suggests using doOnCall then Jan 14 19:28:53 err... sorry, doCall Jan 14 19:28:58 this.doCall() Jan 14 19:29:18 hrm Jan 14 19:29:21 let me try that Jan 14 19:29:48 is your grandparent div a delcared kind? Jan 14 19:30:03 it's the app Jan 14 19:30:13 ok Jan 14 19:30:16 lol, grandparent div, i imagine a div with a cane...... Jan 14 19:30:21 as compared to {tag: "div"} Jan 14 19:30:48 lol Jan 14 19:33:10 GodGinrai: can you jsfiddle it Jan 14 19:33:18 might help give us a better sense Jan 14 19:33:18 changed it do doCall Jan 14 19:33:22 it still didn't bubble up Jan 14 19:35:09 I can't really, since it uses tons of data from the corporate intranet Jan 14 19:35:14 but basicallt Jan 14 19:35:17 *basically Jan 14 19:35:20 what is the issue? trying to catch an event from a grandchild? Jan 14 19:35:27 yes Jan 14 19:35:44 the div sending is being used as a table-row-group Jan 14 19:36:18 WOO Jan 14 19:36:20 * fxspec06_ dances Jan 14 19:36:23 grandchild should define an events block: {onMyEvent: ""} and then call this.doMyEvent() when you want. grandparent should have a handlers block: {onMyEvent: "caughtIt"} Jan 14 19:36:30 and it sends past it's parent table div Jan 14 19:36:36 up to the app Jan 14 19:36:36 i worked around a stupid bug in my app by implimenting a stupid solution, and it worked! Jan 14 19:36:52 fxspec06_: +1 Jan 14 19:37:01 that's the kind of debugging I like to see Jan 14 19:37:18 sugardave: I have that, and the method in the handlers block never gets called Jan 14 19:37:42 * sugardave should have saved the fiddle from the last time he showed this. Jan 14 19:37:54 even tho' I know the bubble is getting called Jan 14 19:37:59 sugardave: you really should'ved linked it from the github wiki Jan 14 19:38:23 GodGinrai: how are you building the table? I wonder if that's the issue Jan 14 19:38:49 it's just divs w/in divs Jan 14 19:39:19 oh, now that I think about it Jan 14 19:39:28 the table Jan 14 19:39:32 (the parent) Jan 14 19:40:00 but are you declaring them as divs? are you appending HTML to the dom? or are these enyo components? Jan 14 19:40:06 keeps the rows in a tbody-displayed div Jan 14 19:40:26 Enyo components, w/ tag: "div"o Jan 14 19:40:51 something like {kind: "whatever", tag: "div" , ...}? Jan 14 19:40:56 or is there no kind? Jan 14 19:41:26 I'm wondering if your declaration is causing enyo to create the wrong thing that won't properly build up enyo events Jan 14 19:41:34 (no idea if this is possible, but I wonder) Jan 14 19:41:37 all of them are kinds, except the row group in the table, which holds the rows Jan 14 19:41:57 (the rows are the sending kinds) Jan 14 19:42:26 and you're certain that the onTap is coming from the row itself? Jan 14 19:42:34 rather than some child of the row Jan 14 19:42:49 yes, I'm certain Jan 14 19:43:27 could the problem be because the table sets the owner of each row to the row-group, which is not a kind? Jan 14 19:44:04 maaaybe? sugardave is more likely to know Jan 14 19:44:22 what does the kind's owner return in that case? Jan 14 19:44:42 what do you mean? Jan 14 19:44:57 this.log(this.owner); in the kind whose parent is not a kind? Jan 14 19:45:16 the row's parent Jan 14 19:45:27 on first blush, I would not expect this to work unless you have enyo kinds up the chain Jan 14 19:45:31 he's looking for something more specific Jan 14 19:45:36 GodGinrai: I meant is it an enyo.instance or an HTML node? Jan 14 19:45:48 er DOM node Jan 14 19:45:48 ah Jan 14 19:46:30 { tag: "div", ... } Jan 14 19:46:37 ^ That Jan 14 19:47:12 that's what you see when you log it? Jan 14 19:47:19 so you have somewhere in some kind's component block: {tag: "div"...} that builds that? Jan 14 19:47:27 yes Jan 14 19:47:38 okay, that SHOULD be an enyo.instance Jan 14 19:48:02 and when I add rows w/ createcomponent, I set owner and container to that div Jan 14 19:48:16 but if that is what is returned when you log it (the string itself instead of enyo.instance), then there is something else wrong Jan 14 19:48:35 no, I didn't log it Jan 14 19:48:52 I was just telling you the parent, because I manually set owner :) Jan 14 19:48:59 GodGinrai: owner gets set to a div DOM node, or this.$.reference to that tag Jan 14 19:49:04 ? Jan 14 19:49:09 should be the latter Jan 14 19:49:28 I used: owner: this.$.rows Jan 14 19:49:34 container can certianly by the DOM node, so that's okay Jan 14 19:49:42 okay, that should be fine Jan 14 19:49:45 hang on a sec Jan 14 19:52:19 shit, just refreshed my fiddle and hadn't saved yet...hold longer Jan 14 19:53:37 k Jan 14 20:01:25 btw, I just used firebug to trace through the line of owners and parents, and going through either the owner or the parent variables, there is a direct path to the app Jan 14 20:06:32 GodGinrai: this is a super-simple example: http://jsfiddle.net/sugardave/pnjSs/ Jan 14 20:06:42 and I think I did save my other one, let me look at it Jan 14 20:08:39 GodGinrai: this one is basically the same thing: http://jsfiddle.net/sugardave/DCNL2/ Jan 14 20:14:06 looking at it right now Jan 14 20:17:23 yea, sugardave Jan 14 20:17:40 my setup is almost exactly the same Jan 14 20:17:42 except Jan 14 20:17:59 that my grandchild is in a div in the parent Jan 14 20:18:07 and mine does not work Jan 14 20:20:46 but the div in question is in the components block of the parent as {tag: "div"} right? Jan 14 20:21:36 yes Jan 14 20:22:01 and I just tried adding a div in your components block, and yours works :( Jan 14 20:22:35 oh duh Jan 14 20:22:40 you are setting owner to that div? Jan 14 20:22:52 it should probably be owner: this Jan 14 20:23:34 the reason I have owner set to div Jan 14 20:23:44 is because I need to loop through the rows Jan 14 20:23:52 and there is no easy way to do that Jan 14 20:24:01 unless they all belong to that div Jan 14 20:24:22 you are confusing me Jan 14 20:24:32 all the rows are kinds, yeah? Jan 14 20:24:38 enyo.Controls? Jan 14 20:24:43 I use getComponents() to grab the rows for an enyo.forEach Jan 14 20:24:56 use getClientControls() instead Jan 14 20:24:59 when I need to loop through the rows in my table Jan 14 20:25:10 if they are UI kinds Jan 14 20:25:14 getClientControls? Jan 14 20:25:37 how does that work? Jan 14 20:26:07 this.$.tableKind.getClientControls() would return all UI controls that are owned by this.$.tableKind Jan 14 20:26:18 without the pesky extra components that you might get otherwise Jan 14 20:26:36 that would still return the headers and footers Jan 14 20:26:41 I need just the rows Jan 14 20:26:55 wrap it in a kind that only contains the rows, then Jan 14 20:27:14 I thin kyou are over-complicating things Jan 14 20:27:59 I know that's an easy solution, but adding objects just for the sake of it is overcomplicating things, imho Jan 14 20:28:39 tableKind -> tableHeaderKind, tableRows, tableFooterKind, tableRows -> tableRowKind, tableRowKind, etc. Jan 14 20:29:10 this.$.tableRows.getClientControls(); would return the tableRows only Jan 14 20:29:14 If there was maybe a way to get everything "contained" by something? Jan 14 20:29:30 container is for DOM placement Jan 14 20:29:38 owner effects the event chain Jan 14 20:29:45 wait, getclientcontrols works on things that aren't a kind? Jan 14 20:29:50 no Jan 14 20:30:06 it works on controls...I thought you said your table rows were a kind? Jan 14 20:30:20 each row is Jan 14 20:30:25 okay Jan 14 20:30:50 the rowgroup is a { tag: "div" ... } Jan 14 20:31:18 this would be easier if you could post a sample with your sensitive data stripped out Jan 14 20:31:44 you can make it not public and pm me if you do Jan 14 20:33:06 hrmmm Jan 14 20:33:38 http://pastebin.mozilla.org/2059344 Jan 14 20:33:50 ^ that's the component list Jan 14 20:33:54 for the table Jan 14 20:34:32 okay Jan 14 20:34:59 the row kinds get put into that Jan 14 20:34:59 so you already have "rows"....you said you do this.$.rows.createComponent({..}); in some kind of loop somewhere Jan 14 20:35:07 yea Jan 14 20:35:32 when you do that, that is where you are setting the owner property of that component? Jan 14 20:35:39 yes Jan 14 20:35:44 it needs to be this Jan 14 20:36:32 now, to get just those compoents, you can later run this.$.rows.getClientControls(); will return an array of just those components you created there Jan 14 20:37:10 I thought you said clientControls only works if it is the owner Jan 14 20:37:47 I may have misspoke Jan 14 20:38:13 it will return all the enyo.Controls that exist in the $-hash for the component Jan 14 20:38:29 er, wait a second Jan 14 20:39:56 hmm, I guess what it really does is return the controls CONTAINED by that component...anyway, you should be setting owner to this if you want to catch events there Jan 14 20:40:08 yea Jan 14 20:40:28 that works now. Now I have to figure out the next bug :P Jan 14 20:40:35 it is perfectly acceptable (and necessary in this case) to have different owners/containers Jan 14 20:41:02 how do I set the value in an onyx.input w/ a method? Jan 14 20:41:34 also, thanks for the help w/ that event :) Jan 14 20:41:43 GodGinrai: also, in the case of enyo ownership, setting those rows' owner to this means that they aren't technically grandchildren (only in DOM containment) Jan 14 20:42:10 well, they are still grandchildren of the app Jan 14 20:42:20 I showed the components for the parent Jan 14 20:42:31 hmmm, there should be .setValue() for input, I think Jan 14 20:43:24 yeah, it is provided by enyo.Input Jan 14 20:45:06 * sugardave submerges for more MVC fun. Jan 14 21:10:25 hi Jan 14 21:11:07 i want to make an Input component to call a js function when is pressed Jan 14 21:11:43 i tried hacking it with {tag:"form", attributes:{action:"javascript:..} Jan 14 21:11:56 but the js function name is not mangled Jan 14 21:12:04 so i cant call enyo methods from there.. Jan 14 21:15:19 anyone? :) Jan 14 21:55:23 hey sugA Jan 14 21:55:26 *sugardave Jan 14 21:55:44 just wanted to say thanks for earlier Jan 14 21:56:01 wIRC disconnected, and wouldn't reconnect Jan 14 21:58:37 GodGinrai: do u know how to call enyo js functions from js? Jan 14 22:00:45 In what way? Jan 14 22:01:15 i want an Input to call a js function when is pressed Jan 14 22:01:28 so i put it inside a {tag:"form".. Jan 14 22:01:51 and set attributes:{action:"javascript:... Jan 14 22:02:02 so i loss the reference to "this".. Jan 14 22:02:12 how can i do this in enyo? Jan 14 22:05:53 placeholder: "Search on Twitter", onkeydown: "searchOnEnter"}, Jan 14 22:05:54 oh Jan 14 22:06:21 https://github.com/enyojs/enyo/wiki/Tutorial-2 Jan 14 22:25:47 sorry, left work, gotta log off :/ Jan 14 22:34:21 np works now :) Jan 14 23:07:13 pancake: Sorry I didn't answer you. Did you find out what you needed to know? Jan 14 23:09:27 GodGinrai: [16:34:21] np works now :) Jan 14 23:09:55 thanks, PatrickC|School Jan 14 23:10:05 np Jan 14 23:19:30 GodGinrai: i found the solution Jan 14 23:19:41 thanks anyway :) Jan 14 23:19:49 that's good to hear. :) Jan 14 23:24:23 https://github.com/radare/radare2/blob/master/shlr/www/enyo/js/console.js Jan 14 23:24:27 here's the code :) Jan 14 23:31:05 oh god. XD My Pre3 just downloaded the HTML from that github page as if it was a text file Jan 14 23:31:37 Can't even read it because of all the html tags around parts of your code for syntax highlighting XD Jan 14 23:40:11 got it pulled up on my pc. neat. **** ENDING LOGGING AT Tue Jan 15 02:59:58 2013