2008-07-11:
[4:54] <Helma8> Grr many to many relations!![6:22] <jkridner> is it possible for getChildElement to return or execute an action?[6:29] <zumbrunn> catching that case would probably more be the job of onRequest or a notfound action[6:29] <zumbrunn> but of course, it can execute anything[6:31] <zumbrunn> and... no, I don't think it can return an action[6:43] <jkridner> k.[6:44] <jkridner> I'll have to look up onRequest.[6:45] <jkridner> is notfound passed the name?[6:47] <zumbrunn> no, you have to dissect req.path[6:47] <jkridner> k.[6:48] <jkridner> I was looking to use getChildElement to call an action in the child object when the child object is a different type.[6:51] <jkridner> I was trying to avoid having a URL like /parent/child/action, when what I want is /parent/action (where I know the child type and just create the child temporarily).[6:53] <zumbrunn> just needs a very smart notfound action[6:55] <zumbrunn> keeping it generic, but looking up what to do by resolving the path to the parent object and inspecting it in order to figure out what to do[6:56] <zumbrunn> this might help to some extent:[6:56] <zumbrunn> http://code.google.com/p/e4xd/source/browse/trunk/objectengine/Mocha/handlers.js[7:08] <zumbrunn> maybe you could catch it using getChildElement if you just abort the current request using res.redirect(), or directly handle it and then stop using res.stop()[7:08] <zumbrunn> bad practice though, I have a feeling[7:13] <jkridner> that doesn't look too bad. I'll sleep on it.[17:34] <midnightmonster> jkridner, it looks like you're starting from a base similar to the sample I sent you, where /parent/new or /parent/someType is a new, transient child of parent, and /parent/new/edit gets you a new form.[17:34] <midnightmonster> then you want to make it so that /parent/new is all you have to type to get an edit form.[17:35] <midnightmonster> If that's the case, just add one line at the beginning of the main_action() of your child type:[17:35] <midnightmonster> if(this.isTransient()) return this.edit_action();
In the channel now:
Logs by date: