Thank you. That works. One thing that others should be aware of when
returning a container with dijit elements is the fact that dojo does NOT
like to reuse the IDs. i.e., if your variable name is lineItemSize, you will
need to set the ID/name of the element to something that is unique every
time you return that container - including the first time the page is
rendered. In my inline -editing example, I am adding the microtime to the
end of every element name. This guarantees that when they edit that line and
click the edit button to set off the xhrPost, the returned form has IDs that
are different from the first time the page rendered. If you don't do this,
you will get something like following error:

An error occurred: Error: Tried to register widget with id==lineItemSize but
that id is already registered

-Mark


Matthew Weier O'Phinney-3 wrote:
> 
> Second, for XHR requests, I always have my view use declarative Dojo
> syntax:
> 
>     Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
> 
> This ensures that you can run the dojo parser over the returned markup.
> Returning and executing Javascript from XHR is often considered a
> security issue, and can additionally be difficult to get to work
> correctly.
> 
> This leads to my third point: you'll need to run the dojo parser again
> *after* you've inserted the new HTML into your DOM. This is done with
> the following call:
> 
>     dojo.parser.parse();
> 
> You can actually run the parser on a containing node as well. So, if
> you did something like the following with the response payload:
> 
>     var formContainer = dojo.byId('form-container');
>     formContainer.innerHTML = data;
> 
> then you'd call this immediately following:
> 
>     dojo.parser.parse(formContainer);
> 
> Hope that helps answer your question!
> 
> -- 
> Matthew Weier O'Phinney
> Software Architect       | [EMAIL PROTECTED]
> Zend Framework           | http://framework.zend.com/
> 


-----
Mark Garrett
DailyDNA
Arkadelphia, AR
(Telecommuting to: Rogue River, OR)
-- 
View this message in context: 
http://www.nabble.com/Dijit-elements-and-xhrPost-tp20276334p20296178.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to