View Full Version : async form posts
JBeckton
10 Mar 2007, 9:44 AM
Using YUI I like the facilities available to handle async form posts. I have a form in a dialog that when submitted YUI marshals the form data into an ajax call to a serverside page for processing then the result is marshaled back to an element (div) on the page.
the div basically holds the search results and the search form is in the didalog box.
can someone give some slick examples to handling async form posts with YUI-Ext
Animal
10 Mar 2007, 10:32 AM
UpdateManager.formUpdate()
See docs.
JBeckton
10 Mar 2007, 11:08 AM
Ok I think I got it...
So I use UpdateManager.formUpdate() which basicaly posts the form to a server side page for processing via ajax. Then I can specify an element in the DOM like a div to display the response using the callback (oElement, bSuccess, oResponse)...?
sound like the right direction?
Animal
10 Mar 2007, 12:59 PM
You don't have to do anything wit hthe response. An UpdateManager is attached to an Element, and updates its Element with the response.
You can examine in the callback if you want, but you don't have to.
Check the excellent documentation which is bundled with the Ext 1.0 download.
KRavEN
12 Mar 2007, 6:16 AM
I am trying to do a same thing from an async page loaded into a tab and I'm running into problems.
I have UpdateManager and the form submit working fine in a static page.
Where I run into problems is when I use tabpanel and load the page with the form async. The page being loaded is only a snippet with no head, body, or doctype. The error I get is the function I'm calling to update the form is not defined. I have the load scripts variable for the updatemanager that loads the document into the tab set.
Ultimately what I want to do is submit the form and then have the respose loaded into the tab that I submitted the form from.
I'm sure I'm missing something simple. If you someone could please point me to an example that does what I'm trying to do I'm sure I could figure it out from there.
erdxoin
16 Mar 2007, 12:23 PM
may be your function definition is in a script block inside the snippet, if this is the case,
yuiext does an eval of what's inside the script block (a function definition becomes useless, being evaled and garbaged). Put your scipt in a separate js file and you're done.
hope that helps
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.