Tyler left out a critical piece of information: This new subclass is for constructing a matrix of checkbox options in a form. You feed it a list of row labels and a list of column labels and it constructs a table of checkbox options:

        Category 1
        Category 2
        Category 3
Option 1
        [ ]
        [ ]
        [ ]
Option 2
        [ ]
        [ ]
        [ ]
Option 3
        [ ]
        [ ]
        [ ]


The suggestion that this should be constructed with divs (or no formatting at all) rather than a table is silly. The setDisplayFormat function in HTMLForm is for setting the formatting of the form itself, not dictating what HTML can and can't be use in the individual elements of the form. The description of the function reads: "Set format in which to display the form". If the display format is set to div, the new subclass put the element in a div. If the display format is set to table, it puts it in a table. If the display format is set to raw, it doesn't put the element in anything. This is identical to the functionality of every existing subclass in HTMLForm. The only difference is that the form element itself happens to be a table rather than an input. Blocking this feature simply because it uses a table doesn't make sense to me. The table doesn't cause any problems in any actual output formats. I've tried it in MobileFrontend (with the form set to raw mode), for example, and it looks fine. I think the purpose of the setDisplayFormat function is being misunderstood in this case.

If anyone is familiar with HTMLForm, please feel free to weight in at https://gerrit.wikimedia.org/r/#/c/48995/.

Ryan Kaldari

On 2/21/13 2:41 PM, Jeroen De Dauw wrote:
Hey,

The new subclass will always output a
table for the getInputHTML(), even if the parent form is set to div/raw
output.

That very much sounds like a violation of the Liskov substitution pattern.
In other words, it sounds like code using an instance of HTMLForm might run
into problems when this instance happens to be of the type defined by the
new subclass.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to