Replied privately. Solution worked by pub/sub and/or event delegation.
Here's what I replied:
--
Hey Robert,
Can you explain the use case? I can't figure out whether you're just
injecting new DOM nodes after the ajax request or whether you're using
it just to flag the application down to remap a particular controller.
You can use Mojo's publish/subscribe for telling your applications to
do something without having to tie yourself down to controller.
After your ajax request, you could add this line:
mojo.Messaging.publish("remapApplicationControllers"); //publish a
message to your application
Then, inside a controller that gets mapped on all pages, perhaps call
it "MessagingController" and map it to the <body> tag. Add this:
this.addObserver(mojo.Messaging.getTopic("remapApplicationControllers"),
"onPublish", "MapControlllers"); //subscribe to the
"remapApplicationControllers" topic
I believe that there is a MapControllers command in
stdlib.command.MapControllersCommand; however, if there isn't-- you
could just add a command called "cox.command.MapControllersCommand",
and have it do this:
dojo.provide("stdlib.command.MapControllersCommand");
dojo.require("mojo.command.Command");
dojo.declare("stdlib.command.MapControllersCommand",
mojo.command.Command, {
execute: function(requestObj) {
var contextObj = null;
if(requestObj.getParams()) {
// parameters: contextObj: String or HTMLElement
contextObj = requestObj.getParams().contextObj;
}
mojo.controller.Map.mapControllers(contextObj);
}
});
if you don't pass a contextObj parameter (DOM Node), then it'll remap
all controllers but if you do pass a contextObj, mojo will map
controllers within that DOM node only.
This isn't exactly best practice since you shouldn't have to keep
remapping all your controllers when the application is already in
runtime; however, it should be enough information to answer your
specific question.
Hope this helps,
Jaime
--
On Sep 30, 6:54 am, Cox-UI-Manager <
robert.sek...@cox.com> wrote:
> Is there a way to remap all controllers after an ajax request has
> occurred? Right now I am doing just the ones that I need like this:
>
> mojo.controller.Map.getInstance().mapController("cox.controller.ToolTipCont roller",