User tests: Successful: Unsuccessful:
There is a phpcs issue with the signature of JHtmlSelect::suggestionlist()
. It contains a required $idtag
after the optional $optkey
and $optText
, which essentially makes those two required as well.
Fixing this correct is basically not possible without creating a new function and proxy it.
The produced datalist also has some errors in it.
JHtmlSelect::suggestionlist()
which was introduced with J3.2 to implement the <datalist>
tag into the text formfield.getInput()
function of the formfield instead. It's a very simple code and the current usage of JHtmlSelect::options()
within JHtmlSelect::suggestionlist()
to generate the items created more problems and was basically overkill.getSuggestions()
in the text formfield and replaced it with getOptions()
like we use in every other formfield. getSuggestions()
is proxied to getOptions()
in case someone was extending the class and actually used it.Add some options to a text field and see if the datalist works. For example change the title for the article form to
<field name="title" type="text" label="JGLOBAL_TITLE"
description="JFIELD_TITLE_DESC"
class="input-xxlarge input-large-text"
size="40"
required="true"
>
<option>Option1</option>
<option value="Value2">Option2</option>
<option value="Value3" />
</field>
It should show a list with "suggestions" as soon as you start typing or click into the field.
Please note that the first option will not show because there is no value given. The second option will show with both the value and the text, depending on browser (Chrome shows the text rigth aligned a bit smaller). The third option will show the value only.
This is based on a Codestyle PR and some discussions we had after it.
Unfortunately I forgot to do the PR then and now can't find the discussion anymore.
In a perfect world datalist lines would be tabbed & splitted in different lines ( adding "\t" & "\n" to lines). But we can wait for layouts to do that.
Yeah, layouts will make that easy
Pfft, rebasing against staging branch when PR is against 3.3-dev isn't going to work. :)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-05-12 14:17:54 |
Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33430