Viewers: in countries Watching now:
Now this video is really a bonus way to do the same thing we did in the last video. So let's open up login.cfm and we'll just change two lines of code. The first thing we're going to do is run the setForm function on the CFC proxy object to tell it that the next call we make to the authentication service should submit the form that we specify as the argument to that function. Now that sounds like a lot, but all we need to do is authService.setForm('loginform'), and again pay attention to do your casing.
We need to make sure that loginform here matches loginform there. So now we're setting our asynchronous Mode, we're setting a form and then we're setting our CallbackHandler. Now we're going to get rid of the arguments for loginUser. "But Dan," you're saying, "how does the loginUser method get the Username and Password?" Well, what the proxy object is going to do now is to go through the login form, which we specified in the setForm method, and then send every form element that the form contains as arguments to the loginUser method.
So long as your form names match your CFC argument names, you don't need to specify any arguments whatsoever in the loginUser call. So let's go to Firefox and take a look at the results. So I'm going to reload my page, I still have it open from the last video, and we're going to type in our Username and our Password and click Login. We'll patiently wait for our login script to do its thing, close this, and we'll open up our request here and look at the Params. Now if you recall, in the previous videos when we looked at the Params we just saw a Username and Password, but now we're also seeing Login, which is the name of our button and that's it.
There are currently no FAQs about ColdFusion 9: AJAX Controls and Techniques.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.