1

Can I use nested childs in a client side controller?

I have a controller action with some child mojits. I render the children with actionContext.composite.execute().

 // controller.common.js ...
 index: function(actionContext) {
   //...
   var cfg = {
     children: {
       //...
     }
   };
   actionContext.composite.execute(cfg, function(data, meta) {
     actionContext.done(data);
   });
 }
 //... 

Can I call this "nested" action from the client? I tried it with the effect that the children are empty.

 // bindes/index.js ...
 me.mojitProxy.invoke('index', {}, function(error, content, meta) {
   me.node.set('innerHTML', content);
 }); 

Another concern is the behaviour of the binders of the children. Every time I invoke index from the client I will get new nodes of the children I think. Could I "rebind" the "nodes" of the nested child actions, if I call them with me.mojitProxy.invoke()?

Is there anywhere an example with a nested client side action. Thanks So - are nested

by
2 Replies
  • My Problems are solved partially (sorry I can't remove the question).

    The effect with the empty children: My child controller with the affinity common called a model with the affinity server from the client. So no model was available.

    Nested binders: It seems that the framework loads only the binders of the parent controller. If I call the index action of the controller on the server I get the binder of the parent, but not the binders of the childs (called with actionContext.composite.execute()).

    That leaves the questen open: Can I nest controller actions with its binders? Or do I have to add the binder logik of the child actions to the parent binder.

    0
  • Hi,

    You should be able to nest mojits, and mojito should be setting up the child binders (to any depth) for you. So, this sounds like a bug in mojito. Feel free to file an "issue" in github (with as many details as you can include, especially mojito version).

    Drew

    0

Recent Posts

in Yahoo! Mojito