Everybody needs AJAX

Everybody needs AJAX

  
Need an AJAX sample?

Everybody nowadays gets requests to update a web page asynchronously. It's cool, it's hip, it improves user experience, it's web 2.0.

In this topic I'll post two samples for different patterns of AJAX usage.

Fill free to participate in this topic with your own samples. Cheers
André
This is the most common usage for the combo box fill up pattern.

The purpose is to fill combo boxes values based upon previous selections (eg: Show Districts of a selected Country, etc.)

Try it now: http://onlinedev.outsystems.net/ComboBoxAJAXFillup/

Special thanks to Gonçalo Veiga for providing me with the initial sample. Requirements:
- SS 4.0.1.7.
- prototype framework (scriptaculous extension provided includes prototype)
Can be ported to other SS versions

PS: File provided is a OutSystems Package file. It can be opened with WinZip or WinRAR and it can be published directly in service center.
Cheers,
André
This sample is based upon Lucio's 3.2 AJAX sample (thank you Lucio for the help provided :)).

Updates a list of containers (DIV's) by performing a request to the server associated with a submit link.

Try it now: http://onlinedev.outsystems.net/AJAXRefreshContainer/
Requirements:
- SS 4.0.1.7 (Can be ported to other versions)
Limitations:
- The solution does not deal well with nested containers. Try to use the innermost container.
- Only links are supported as the target of the request.

PS: File provided is a OutSystems Package file. It can be opened with WinZip or WinRAR and it can be published directly in service center.
Cheers,
André
There has been some requests to have this sample in SS version 3.2.

Installation instructions - unfortunately there are no solutions in version 3.2:
- Publish all the extensions.
- Publish the .OML file. (If publish fails through service center use service studio and remember to refresh the references.)

So here it goes.

André Madeira has suggested a change that he made implemented which is to add parameters to the request javascript function with the entry point name and parameters. This allows the reuse of the javascript function. Thank you André.

Also thanks to Ana Santos who lend me her development environment to test the sample.
Cheers,
André
Does the trial url work?
http://onlinedev.outsystems.net/ComboBoxAJAXFillup/
Oops, missing some data on the database :)

Fixed!
Cheers,
André


The top 10 mistakes when using AJAX

If you're considering in using AJAX in your application, perhaps you should read these rules-of-thumb first.
There's really no harm in thinking thoroughly the solution...
Cheers,
André