zend framework - DOJO : How do you reinitiate form elements after ajax call? -
I'm trying to do some things using the Zend Framework & amp; Dojo Toolkit, and any help would be appreciated. Here's the problem:
I have a form that is provided with the Zand Framework Form Class, which has an AJAX radio button selection. Clicking on one of these radio buttons will send an AJAX request to another controller, which has no layout, only one rendered form. Ajax request will then populate a device with new form options.
The problem is, when I change the DIV's internal HTM with AJAX feedback, all form inputs and elements are not inheriting the same dojo style and form validation
I was wondering if there is any way to recreate the form elements after an AJAX call?
I tried to use this code which I found and modified a bit for this example, though it did not work. If I use the line dojo.parser.parse (div);
There is no change (in the example RG_ADRE is the ID of a form element placed on DOM) here is console.log of rg_address:
; OnClick = 'dojo.xhrGet ({url: "/ transfer / newrecipient /", handles: "text", timeout: 10000, // time in milliseconds // Load function will be called on a successful response Load: function (HTML ( $ ("#nupided"). Html (""); var div = dojo .byId ("rg_address"); console.log (div); dojo.parser.parse (div); return response;} , // Error function will be called in an error case. Error: Task (Reaction, ioArgs) {$ ("# NewRecipient") .html ("Error loading registration"); $ ("# newPayMethod"). (""); $ ("# NewPayDetail") .html (""); return copy Verb;}}}; '
thanks, darl
I have only one question and I got a possible answer:
What I think, you need to do something that is in your function, which calls AJAX Is said to handle data received from:
function update form (data) {var targetNode = dojo.byId (\ "step2 \"); TargetNode.innerHTML = data; Dojo.parser.parse (targetNode); }
Works with:
Zend_Dojo_View_Helper_Dojo :: setUseDeclarative ();
But I want to use programmatic. I will post a question about this.
Comments
Post a Comment