It appears (for the struts users in the crowd, OR any other HTML
oriented users)... the HTML spec is not completely defined for what to
do when a user presses the enter key on an HTML page with the form.

(see http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html for a
very thorough and informative discussion on this topic.)

More specifically, under some cases with some browsers pressing the
enter key causes the form to be submitted, but does NOT include the
(name,value) pair of ANY of the buttons on the form.  

This has the nasty effect (at least in keel 1.0 branch) of causing the
struts portion of keel to be unable to determine which command to
process and as a result fail when it attempts to run a "null" model.

I wrote this email for two reasons:

   First) I wanted to point it out as a possible problem that is
(probably) also in the main branch of keel... hoping that this will lead
to a fix if one is needed.

   Second) To share how I am addressing it in the 1.0 branch.  I should
start by saying that I'm not being lazy here... I looked at the current
head, and it appears that Sash has done an excellent job a refactoring
that code (thanks Sash).  It just means that since I'm still stuck in
the stone ages (the 1.0 branch) it seems that my fix (at least code
wise) won't apply to the head anymore.

So here's what I probably should have done ;-)  Allow a programmer to
specify a command as the default.  Then, when keel processes a page if
it doesn't find a model that was specified and it also doesn't find that
a command was selected, then have it look for the command that was
specified as the default command and run them command instead of giving
an error message.

Here's what I did instead (a small short-cut in the interest of time). 
I didn't add a way to specify the default command (shame on me). 
Instead, if no model was found and it appears that no command was
selected, then I changed keel to look for the following commands in the
following order ("DEFAULT", "SUBMIT", "PROCEED").  If any of these
commands are found, then keel will execute the first command found. 
Otherwise it will continue with it's current behavior of producing an
error.

I've made these changes locally... and I plan to check them into the 1.0
branch after I have verified that they work.

        Sincerely,

          (and FYI)

             -Phil

http://keelframework.org/documentation
Keelgroup mailing list
[EMAIL PROTECTED]
http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com

Reply via email to