[Html-widget] retain_default() for a HTML::Widget::Element::Button?

Bernhard Graf html-widget at augensalat.de
Thu May 10 21:48:00 GMT 2007

HTML::Widget::Element::Button has a retain_default() accessor.

If true, overrides the default behaviour, so that after a field is 
missing from the form submission, the xml output will contain the 
default value, rather than be empty.

But why?

A button value (the label) cannot or at least should not be changed by 
the user (see bottom of page) - or do I overlook something?

I ask because I struggled some time with HTML::Widget to find out why a 
submit button of a form didn't get a value. Finally I found the reason 
is because for the corresponding form I always call process with the 
HTTP request object as argument -


- even at the initial call (*).

I set retain_default(1) on this submit element now and it works, but 
actually as I said I think retain_default() is unappropriate for a 
button element and in HTML::Widget::Element::Button::containerize() the 
        and $self->retain_default || not $args->{submitted};

should be removed.

(*) To set and check initial form values. Thus currently (and without 
retain_default(1)) I'm also able to set the value of the submit button 
(the name is also "submit") by calling the page like this:


Does anybody need or want this behaviour?
Bernhard Graf

More information about the Html-widget mailing list