Problems with AJAX in block add and edit pages

Permalink
I have created a block with working add and edit pages. Since I am using the file manager and Tiny MCE I was hoping to use AJAX on the add form, as dynamically generated form elements will not get the file manager and Tiny MCE functionality.

The issue that I'm having is finding the Url to direct the Ajax request to the controller method. From the view.php page I could use:

$this->action('some_action');

But this will not work from the add or edit pages. Can anyone suggest how I can get this Url or alternatively get TinyMCE and the file manager working on elements created with JavaScript?

 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
Your problem arises because the block does not exist until after add is complete, so you cant get to an action in the block controller. The solution is to put the ajax code in a tools file.

See:
http://www.concrete5.org/documentation/how-tos/developers/ajax-less...

and
http://www.concrete5.org/marketplace/addons/ajax-lessons/...