Tuesday, September 11, 2007

AJAX Control Toolkit: broken samples work now

Since the last update I have fixed all the remaining bugs and all the samples work now just the way they do on MS.NET. To run all the Toolkit samples, you will need mono from svn trunk, at revision 85628 or newer. As a reminder, the samples that didn't previously work were:
  • CascadingDropDown. The reason it didn't work was that Mono's WebServiceParser incorrectly treated the paths passed to it.
  • Filtered TextBox. The reason this one didn't work was a problem in the way TemplateControlCompiler treated arguments of type Type in the GenerateObjectInstance method: it would generate code to instantiate an internal type System.MonoType instead of the (correct) typeof expression.
  • HoverMenu. Fix for this one was a change in the logic which dealt with controls inside templates (see this post)
  • ListSearch. This one required implementation of the System.Web.Extensions.Design assembly as well as a few missing pieces of the System.Design one. I've added stubs for all of the missing pieces to mono svn trunk.
  • NumericUpDown. This one was made to work by the same WebServiceParser fix mentioned above.
  • ReorderList. Frankly, forgot what fixed this one :)
  • AutoComplete. This sample deserves a special mention. It still doesn't work for me, but Daniel Nauck reported it works for him with FireFox 2, Opera and IE7 on both Windows and Linux, with Mono from svn trunk. So I'll assume it works too and that there's some client issue on my side.
Shown below is a screencast demoing all the above samples (except for the AutoComplete one, of course). You will also note a JavaScript error at the end of the screencast - it happens every now and then, but it is probably a glitch in FireFox (at least in my copy) and it doesn't affect the demo:

Monday, September 10, 2007

Linux+Gnome on TV?

Whenever I watch a movie or some TV series and they show a glimpse of a computer screen, I like to freeze the picture and take a look at what it might be (and how credible what they show is, sometimes :D). Recently, I've started watching the Numb3rs show and in the 2nd episode of the first season (Uncertainty Principle) one of the main characters, a genius mathematician, explains a certain search pattern to his colleague from the University using the well-known Mines game. When I saw the sequence, what was on the computer screen seemed familiar, so I froze the frame and I think what you see on screen is GNOME (my guess is that the OS is some version of Ubuntu), here's the screenshot:

Even though it is definitely not the version of Mines shipped with Gnome, I do think the notebook is running Linux. Cool :)

Most people seem to think it's MacOS/X, but I'm still not convinced (being stubborn as I am) :)

It seems it really is MacOS/X... oh well :) Will keep trying!

Friday, September 7, 2007

AJAX Control Toolkit Update: what doesn't work

Since yesterday, the following samples started to work:

  • HoverMenu. The result this one wasn't working was twofold. First, there was a bug in our implementation of TemplateControlCompiler which incorrectly exposed all the controls contained in a template marked with the TemplateInstance.Single attribute if any of template children was marked that way. The correct action is to expose only those controls which are either direct children of such template or whose parent containers are templates themselves (unless the parents bear the attribute, of course). Fixed in svn commit to revision 85473. The second problem was non-portable coding in the Toolkit itself. To make the sample work you need to modify the App_Code/TodoXmlDataObject.cs:

    Line 92 should read:
    get { return Path.Combine(RootPath, String.Format ("App_Code{0}TodoItems.xsd.orig", Path.DirectorySeparatorChar)); }

    Line 204 should read:
    get { return Path.Combine(RootPath, String.Format ("App_Data{0}TodoItems.xml", Path.DirectorySeparatorChar)); }
    On line 92 the TodoItems.xsd.orig should be the name of the file you renamed TodoItems.xsd into.
  • FilteredTextBox. This one will work if you modify code starting at line 47 in the FilteredTextBox/FilteredTextBox.aspx file and remove either the Custom or the Numbers string together with the comma from the value of the FilterType attribute. It is not, of course a fix, but a workaround to show that the sample does (generally) work. Fix will come soon.
  • AutoComplete. It has every right not to work, because it doesn't work when the toolkit is running under MS.NET either. The webservice works correctly (which you can confirm by visiting http://localhost:8080/AutoComplete/AutoComplete.asmx directly).
The rest of the fixes must wait till after the weekend.

AJAX Control Toolkit on Mono

As some of you probably already know, thanks to great work by Mainsoft we can run Microsoft AJAX applications with Mono from svn trunk now. As long as the System.Web.Extensions namespace is almost complete, there were missing (or buggy) bits and pieces inside the System.Web assembly provided by Mono.
In the past two days I've been implementing the missing and fixing the buggy code to get the AJAX Control Toolkit running without modifications under Mono. Today it works nearly in 100%!
There are few things that don't work, but I'll leave it for later, since first I want to present a small screencast showing that the toolkit does run under Mono :)

The screenshot below shows that the toolkit is indeed ran under Mono's XSP (weak proof, but what's a blogpost without graphics, eh? :D):

The screencast below shows some of the demos in action (some demos don't work, see further down the page).

What doesn't work (and why):
  • AutoComplete. There's a problem with the remote service, haven't checked what is the problem yet.
  • Cascading DropDown. Another problem with the remote service, also not checked for details yet.
  • Filtered TextBox. The sample throws a weird parser exception, will take care of it soon.
  • HoverMenu. Throws errors about duplicate controls.
  • ListSearch. Throws a NullReference exception.
  • NumericUpDown. This one works in all cases except the one which uses a web service.
  • ReorderList. Depends on the existence of the TodoItems.xsd file which I had to remove (see below).
All the other samples work without problems. I'm going to take a look at the failing ones tomorrow and, hopefully, make them work.

There's one other issue you need to keep in mind if you want to test the toolkit on your Linux machine: the Mono's XSD generates invalid code from the TodoItems.xsd file that comes with the toolkit. To make the sample website work, you must generate the .cs file from the above .xsd with the .NET version of the tool:

xsd TodoItems.xsd /c

then put the result file in the SampleWebSite/App_Code directory and rename the TodoItems.xsd file to, for instance, TodoItems.xsd.orig

At this point you should be able to play with the demos.