The GSoC coding period is almost over and my final major task is to enable the combobox and tokens input types in the MultiPageEdit as well as the spreadsheet display for FormEdit.

Enabling combobox and tokens input types

Combobox and tokens are set as the ideal input type for a field if the field type is Page for Cargo or if the property type is _wpg for SMW. If the field consists of a list of values, then the input type is tokens, else it is set to combobox.

Luckily for me, the Page Forms extension already supports combobox and tokens using the select2.js library. I simply used the pf.select2.combobox and pf.select2.combobox prototypes to render the combobox and tokens input types by using them on input tags.

Combobox input type Combobox input type
Tokens input type Tokens input type

Autocompletion for combobox and tokens

There are two types of autocompletion that can be used, either the options in the dropdown are set before the page is loaded or if the number of options are more than a predefined limit which is set by the global variable $wgPageFormsMaxLocalAutocompleteValues, they are loaded using remote autocompletion. Remote autocompletion uses the pfautocompleteAPI to get the values.

Patch(es) on Gerrit: