Montag, Mai 21, 2007

Using webservice calls with multiple parameters

The restriction that the AJAXEngine supported only methods with one parameter had been a topic to some postings in the blog and also to some good comments with good solutions.

Because the problem was only restricted by the AJAX Engine itself and not by the underlying JavaScript proxy layer I looked for a small and neat solution and finally found that the often overlooked Javascript method apply

helps here.

The implemented way of passing more than one parameter is (like suggested) to use an Array as a return value of the prepare function. Because arrays are also supported as a parameter to the called method itself a extra hint is used to distinguish these 2 scenarios.

Here is how to implement the prepare method for this case:

prepare: function (ds) { 
  var p = new Array();
  p[0] = ajaxForms.getData(ds.form);
  p[1] = "name";
  p.multi = true; // the hint for the ajax Engine

The changes in the AJAX Engine layer is only a condition check and a call using the apply method:

// start the call = ajax.Finish; = ajax.Exception;
if ((data.constructor == Array) && (data.multi != null)) // 19.05.2007, data);

If you want to use this feature, you can download the ajax.js file directly. A complete version will be available some day soon including new samples and features.

Montag, Mai 14, 2007

Accordion menu

I added another visual effect for HTML that is called an accordion menu by using a JavaScript Behavior.

An accordion menu is a collection of multiple, stacked panels.

Only one of them is visible and another can be opened by clicking the header of a closed one using a smooth transition of the heights of the content area of the panels.

Have a look at:

Mittwoch, Mai 02, 2007

A new version of the book "Aspects of AJAX" is online

Beside writing some more pages it also contains some corrections and the new posts on this blog where added also.

You can get it for free from