Skip Menu |

This queue is for tickets about the Catalyst-Controller-HTML-FormFu CPAN distribution.

Report information
The Basics
Id: 42267
Status: rejected
Priority: 0/
Queue: Catalyst-Controller-HTML-FormFu

People
Owner: cpan [...] fireartist.com
Requestors: sundial.services [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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!)
I find setting either value() or default() on a ContentButton yields the same output. Because _Field.pm aliases default() to value() with *default = \&value; And ContentButton.pm doesn't override either, I don't see how there could be any other behaviour. Can you send a failing test file if you still have an issue?