[Grok-dev] Server Control - Admin message - functional change

Uli Fouquet uli at gnufix.de
Sat Feb 9 10:52:28 EST 2008


Hi there,

Michael Haubenwallner wrote:
> There is a small problem with grok/admin/view_templates/server.pt
> 
> When you enter some text into the input field under "Manage server 
> process" or "Admin message" and hit RETURN instead of clicking the 
> [Save] button, the form is submitted - but it is not sure, which one of 
> the three button actions is executed.
> In fact i accidently stopped my instance a few times until i found the 
> reason.

Thanks for the report.

> This is a common problem with multiple submit buttons.
> There are 2 solutions: create three distinct forms to handle each of the 
> action groups or add some Javascript to disable return keys inside the 
> input fields.
> 
> I've choosen the second option, attaching a patch for the file.

Thanks for the patch! To tell the truth, I'm personally not too happy
with a JavaScript solution here. Especially when I see those IE/firefox
specific stuff. 

It's easy to make two forms out of the one, which serves the same
purpose, does not depend on JavaScript and needs less code (see attached
patch). The only drawback would be, that running instances had to be
restarted once, after updating the sources.

What do others think?

-- 
Uli

-------------- next part --------------
A non-text attachment was scrubbed...
Name: server.diff
Type: text/x-patch
Size: 1212 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20080209/5c3b6d1b/server.bin


More information about the Grok-dev mailing list