[Html-widget] HTML::Widget::Element::Field

Bernhard Graf html-widget at augensalat.de
Mon Nov 6 17:08:58 GMT 2006


Zbigniew Lukasiak wrote:

> Now when I think about this I think that you are probably right that
> the designer does not normally need to change the type of the field.

Normally not, but sometimes yes.
I've had this situation some time ago:

On a page the user must enter where to send his goods:
- Germany
- Europe
- Worldwide
I did this with a <select size="1"> element.

Later this project was deployed for North America (USA+Canada)
Now the choice was something like:
- Zone 1: Shipping within my country of residence
  (Except to Alaska, Hawaii, NW-, Yukon- and Nunavut Territories)
- Zone 2: Shipping outside my country of residence
  (Except to Alaska, Hawaii, NW-, Yukon- and Nunavut Territories)  
- Zone 3: Shipping to Alaska, Hawaii, NW-, Yukon- and Nunavut 
Territories.
 (If shipping within the same State or Territory, use Zone 1)

This didn't fit into the <select> box. So I (now being the designer 
working on TT2 templates) chose radio buttons here. Does virtually the 
same, but is another field type.

So perhaps the solution would be some sort of meta type, where each meta 
type can be turned into certain choice of real field type, e.g. a meta 
type of "choice" could become a radiogroup or a select-with-size=1 
field; a meta type of "multiple choice" could become a checkboxgroup or 
a select-multiple field; meta type "string" could become "text", 
"password", "textarea".
-- 
Bernhard Graf



More information about the Html-widget mailing list