Execute Action (Watch the Console)
For any of the Ajax components that provide onSuccess, onComplete, etc, it is important to understand that the value of the binding should be a javascript function REFERENCE, not a call to a javascript function. If you have a function "function testFunction() { alert('hi') }", you should not make your binding: onComplete = "testFunction()"; rather you should make it: onComplete = "testFunction"; In the first case, testFunction will be called IMMEDIATELY upon evaluation of the request and its return value will be passed to to the onComplete event callback. In the second case, the testFunction itself will be used for the onComplete callback. Similarly, if you wanted to alert('hi') in-place, your onComplete value would be "function() { alert('hi'); }" rather than just "alert('hi')".

Replace Contents with replaceID binding
This area will be replaced when you click "Replace Contents".

If you use an AjaxUpdateLink with replaceID, it is fundamentally different than updating an AjaxUpdateContainer. In the case of an AjaxUpdateContainer, the update container component behaves exactly like a normal stateful component in a non-Ajax page except that it supports replacing its contents with a background Ajax call.

With the replaceID binding, you are simply targeting the WOActionResults of your AjaxUpdateLink to write into an arbitrary div on the page. ReplaceID updates do NOT behave nicely with component actions. They are intended to give you a broader freedom in updating areas of a page in exchange for not supporting component actions. For instance, with AjaxUpdateContainer, you must anticipate the area of the page that will be updated and wrap it in an update container (so that it has a known place in the component hierarchy). With the replaceID binding, there is no such restriction. If you attempt to use a component action inside of this area, it will result in an immediate backtrack exception. People will die. Only use direct actions.

If component actions are what you desire, check out the Update Examples -- there are lots of cool things you can do with them.

Ajax Hyperlink Function

Ajax Update Function

Ajax Submit Function

AjaxSubmitFunction2 Javascript Link

Repetition of AjaxUpdateLinks Last Updated: , Selected:

onClickServer Example

Javascript Response Example This is a clickable container!
Click me!
This is an ajax clickable container.