**** BEGIN LOGGING AT Thu May 23 03:00:00 2013 May 23 04:09:13 this is maybe a silly question, but is there a way to fully reset a component, and put it in the state that it would have been upon being newly declared/created? May 23 04:09:25 ideally without a destroy()/createComponent() cycle May 23 04:10:08 hrm May 23 04:10:17 What do you need to do that for? May 23 04:11:03 the form creation section of my app has a "cancel" functionality May 23 04:11:09 and I'd like to reset everything when that occurs May 23 04:13:01 Well, for my application, when I had to reset my form, I just made a function that would iterate through all the elements and setValue to "" May 23 04:13:18 what kind of elements are you needing to reset? May 23 04:31:26 it's not explicitly elements in all cases, I've got a bunch of sub-kinds I'd like to have the state re-set on as well May 23 04:32:12 can you give me an example? May 23 04:34:27 well, like that list structure I was working on earlier May 23 04:34:42 (which, obviously, you can just clear the data on) May 23 04:35:00 but it means building out a whole "clear" infrastructure in all of my kinds May 23 04:36:26 Well, making reset/clear functions are not that hard May 23 04:36:42 Do you have a lot of unique kinds that need to be cleared or something? May 23 04:36:45 no, just irritating May 23 04:37:04 a fair amount... probably... 10 or so? May 23 04:37:40 hrm May 23 04:38:25 In my case, due to the infrastructure I used to make it so I could get all of my Form Data, I was able to accomplish a clear w/ a one-liner May 23 04:39:22 that's an interesting thought May 23 04:40:16 I made sure that my 2 custom form elements supported the get/setValue convention May 23 04:40:54 then I just had to mark them all as form elements in my form, and loop through my array of form elements w/ enyo.forEach calling a function that would getValue May 23 04:41:03 that was for getting the data May 23 04:41:08 then when I needed to reset May 23 04:41:11 I did the same thing May 23 04:41:19 but used setValue instead May 23 04:41:24 to set them all to "" May 23 04:42:11 yeah, but that's form elements on a given view May 23 04:42:20 all contained in one kind May 23 04:44:01 mmmm.... kind of May 23 04:44:21 One of my custom elements was a composite form element May 23 04:44:37 A checkbox that enabled buttons if the checkbox was checked. May 23 04:45:03 For that one, I had to make the get/setValue functions more complex to handle that May 23 04:45:21 (*radio buttons, not just buttons) May 23 04:45:25 oh, but you're saying you had a defined API May 23 04:48:38 yea, I made everything use the get/setValue API so that I could do it all in one loop May 23 04:48:47 that makes sense May 23 13:26:02 Morning May 23 13:31:58 it certainly is May 23 13:33:48 hey guys, does anyone here know how to use fail() and recover() from enyo.Async? I'm having trouble understanding how to call them May 23 13:42:31 HaDAk: well hope it's a GOOD Morning ha May 23 13:42:38 well. we'll see. May 23 13:43:11 GodGinrai: don't want to use the enyo.Ajax wrapper for Async? May 23 13:44:19 I am using enyo.Ajax. May 23 13:45:11 I only said enyo.Async because enyo.Ajax is descended from enyo.Async May 23 13:45:22 ah ok May 23 13:47:53 I'd call fail from inside response: if some data that came back wasn't what I wanted and recover from error: May 23 13:48:02 just talking it out May 23 13:48:10 where are you hitting the wall? May 23 13:50:07 the example on "Consuming Web Services" show to use this.fail() in the handler May 23 13:50:12 but when I do that May 23 13:50:31 I get an error saying no such function exists for this.fail() May 23 13:56:43 going off that example, maybe it should be this.async.fail() May 23 13:56:57 oh never mind that May 23 13:58:24 if you add a foo: function () to your object can it call foo? May 23 13:58:55 what do you mean? May 23 14:03:44 I'm looking at the example and in the var transaction they have that instance async, which you added a fail: function() to right? May 23 14:06:18 no. fail is a predefined function of enyo.Async May 23 14:09:03 yeah it should be, but maybe add fail: function(err) { enyo.log('fail'); this.inherited(err); } just to see? May 23 14:12:05 that wouldn't help May 23 14:12:47 If I just create a fail function, it won't have the special functionality that I need it for. May 23 14:16:52 oh I know, I'm just tyring to see if we can isolate it being possibly a scope issue May 23 14:34:23 that wiki page needs to explain this better May 23 14:34:38 I just figured out how to get it to work May 23 14:43:53 what'd you need? May 23 14:45:16 the reason you could use this.fail in the example (a reason they did not explain) was because the context for the handlers was the async object. May 23 14:45:56 Whereas I was setting my context to this May 23 14:46:15 in other words, my object was the context May 23 14:46:21 got'cha May 23 14:46:30 had a similar problem and had to use enyo.bind May 23 14:46:39 well May 23 14:47:02 in my case, I could get around this problem by using: inSender.fail() May 23 14:47:46 because for async handlers, inSender is the Async object May 23 14:48:47 nice May 23 15:26:57 hey sugardave: I need to center yes and no buttons on a modal popup. How would I go about doing that? May 23 15:27:47 put them in a FittableColumns that has the class "enyo-center"? Use CSS? Try out the FlexBoxes? The world is your oyster May 23 15:28:30 the trick is, create/render those components in the popup, resized on the popup, then show it May 23 15:30:44 Can't do Flexboxes yet, I doubt the IE8 support for it is too fleshed out May 23 15:33:03 they are also computationally intensive May 23 15:35:40 ouch May 23 15:36:07 hey btw May 23 15:36:46 how come enyo-center only works on FittableColumns? Wouldn't that also be really useful for ToolDecorator? May 23 18:38:14 hey sugardave, is there some simple way to suspend a function while you answer a modal popup question, and then continue execution of the function once it is answered? May 23 18:41:44 could that be possible with javascript? think you have to have a seperate method run on answer May 23 18:42:44 :/ May 23 19:01:30 yeah because it's not single threaded you won't be albe to hold up execution. May 23 19:02:23 unless, maybe have a timer set to check the value of the modal popup input value and have a while() running until there's a value? May 23 19:02:26 hacky May 23 19:29:14 :/ **** ENDING LOGGING AT Fri May 24 02:59:58 2013