Thursday, March 22, 2007

Dojo Hacking at CSUN

dojo and mozilla geeks
We hacked on dijit aria stuff today in the Mozilla hacking room. Show above are Becky, Simon, Gijs, and Earl. (I blogged this from the room moments after this pic was taken).

Wednesday, March 7, 2007

Radio buttons as spans

Hi all. Becky and I were the only ones on the call today. Thanks Becky for answering lots of questions!

I just want to note something... think aloud a little more if you don't mind... about radio button groups in dojo. As it stands now radio buttons are spans (attached as "domNode") with a div node (attached as "imageContainer") and a hidden input node (attached as "inputNode"). The div node represents visually the dojo checkbox. The attach points are not really relevant but I like to remind myself as I'm still a noob.

Here is a screenshot of dijit/tests/form/test_Checkbox.html with firefox and firebug.

I think (and I hope to confirm tomorrow) that the fact we don't have visible input nodes with name attributes means that we are losing the otherwise "free" access to "group" (grouping by name) information that browsers glean with regular radio input elements.

One solution might be to expose the hidden input name attribute by adding a name attribute (hmmm is that a standard attribute?) to the (non-hidden) span element (also known as the domNode). We could make sure that browsers check the name attribute for grouping purposes for any element with wairole that is form-element-ish (like a wairole of "radio").

We should definitely ping Aaron on this when he's around.

Scratching my head...

Tuesday, March 6, 2007

RadioButton keynav patch v2

I've posted radiokbnavpatch.txt for your reviewing pleasure. Thanks reviewers for helping me out on the last one. Becky thanks especially for the very informative chat today.
Still to do: provide group information...

Friday, March 2, 2007

Successfully arrowing radio buttons!

Here is a Checkbox.js patch which implements radio button left/right arrow navigation. It uses Wild Bill's nifty modulo suggestion (thanks Bill).

It skips over any disabled radio buttons to the next available radio button in the group and wraps around if necessary. It is a finite loop.

When I find an appropriate candidate radio button I call radio.domNode.focus(). Does that seem correct? (Note: I need to set focus to the target radio button so that the next key event goes to the correct radio button). I also call radio._onClick(null) to (ultimately) set the value true. I suppose I could just call this.setValue(true) directly (perhaps with a check to make sure it isn't already checked like the _onClick handler does).

Regarding style... I've used some shortish local variable names to try and keep the source small. I get the idea from the style guide that permissible name terseness varies directly with scope... which makes some sense to me. I'd like feedback on this too if possible... well actually any and all feedback is appreciated.

Thursday, March 1, 2007

HTML control groups and keyboard navigation

Just a quick note that I put up a test page with various permutations of checkbox and radio groups. I was inspired by Bill's checkbox group test and added elements in order to test arrow key navigation. Looks like it is limited to radio "groups".

Dojo development environment with Eclipse and Apache

I have just set up my development environment for Dojo using Eclipse and Apache and I've written up the steps that I followed in case they might be useful. I'd also love to get feedback if you have any comments or suggestions for other approaches.

I'm using Eclipse 3.2, Apache 2.2, and the Subclipse Subversion plugin for Eclipse. This set up was done on Windows but the configuration should be very similar for other operating systems.

I created a new Eclipse workspace for my Dojo work.

Check out dojo and dijit

Go to the Eclipse "SVN Repository Exploring" perspective and add http://svn.dojotoolkit.org/dojo to your "SVN Repository" view.

Checkout http://svn.dojotoolkit.org/dojo/trunk and select "Check out as a project configured using the New Project Wizard". Choose General/Project as the project type and call it "dojo".

Checkout http://svn.dojotoolkit.org/dojo/dijit/trunk in a similar fashion and call it "dijit".

Ignore .project

When you checkout dojo and dijit it will initially look like they have modifications (an asterisk will appear on the project icons). Eclipse has created project files for us and, as these are not in the svn repository, they show up as modifications. We can get Subclipse to ignore these project files by using the "Ignored Resources" section of the Preferences (Preferences/Team/Ignored Resources). On this page select "Add pattern..." and add ".project". You may have to restart Eclipse for the ignored pattern to take effect.

Server up dojo and dijit with Apache

You can serve up dojo, as /dojo, and dijit, as /dijit, with the following Apache aliases. You will need to replace "C:/Dojo workspace" with the location of your Dojo workspace.
Alias /dojo "C:/Dojo workspace/dojo"

<Directory "C:/Dojo workspace/dojo">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /dijit "C:/Dojo workspace/dijit"

<Directory "C:/Dojo workspace/dijit">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>