Subject: | HTML::FormFu::Element::ContentButton generates empty "value=" |
Date: | Fri, 9 Jan 2009 22:18:30 -0600 |
To: | bug-Catalyst-Controller-HTML-FormFu [...] rt.cpan.org |
From: | "Sundial Services" <sundial.services [...] gmail.com> |
The HTML standard for a "<button>" tag says that one of the acceptable
attributes is "value," but an attempt to specify that value by setting the
"value" property to a ContentButton results in an empty string. *(Note:*
using TT rendering.)
Observing that the template-toolkit template for this element-type tests "[%
IF self.value.defined %]", I see (by the presence of the ' value="" ' in the
generated output, that this attribute *does* exist. But it's empty.
Looking a this little bit more closely ... I see in the code that "value" is
defined (in HTML::FormFu::Element::_Field") using an *"output* accessor."
So, maybe that's why it's showing up yet showing-up empty.
*"Bah!,"* says he, *"if the documentation says that 'value' is usually
equivalent to 'default,' I wonder what will happen if I try 'default'
instead?"* And Lo! It works! A Workaround Has Been Found! But... why?
I think it's a bug. Either in the code, or in the documentation. "Value"
is a legitimate attribute for this tag, so In An Ideal World it would be
accepted. If the implementation is crufty to do that (as it may well be),
then if "default" is a workaround ... that workaround should be documented.
(P.S. An amazing piece of work!)