User tests: Successful: Unsuccessful:
#Index
I think the purpose of that method is that we had different methods to get layout data for the label and for the input of the fields but we only need a single getLayoutData()
that can be passed to getLabel()
and getInput()
. Sometimes frontenders face an issue that involves rendering the label of the field in the field itself. And that's easier if you have everywhere the information required to render anything.
Now all the fields that extend JFormField
can inherit the getInput()
method and mostly remove it. Actually that should be our priority because getInput() method is the bigger headache for frontenders now. Removing it clearly sets a line betwee what backenders need to do (populate the required data in the getLayoutData() method) and frontenders need to do (style that data in the layouts).
Note that currently all the fields override the getInput()
method so at current state only direct childs of JFormField
will inherit getInput()
. A good example is JFormFieldCheckboxes
that inhertis JFormFieldList
. So until the getInput()
mehotd of JFormFieldList
is not moved to a layout JFormFieldCheckboxes
has to keep his own override.
Now fields that use the new JLayoutFile renderer will allow that developers enable/disable debug mode in the form XML just adding debug="true"
.
Example:
<field name="lineNumbers" type="radio"
class="btn-group btn-group-yesno"
debug="true"
default="0"
filter="options"
description="PLG_CODEMIRROR_FIELD_LINENUMBERS_DESC"
label="PLG_CODEMIRROR_FIELD_LINENUMBERS_LABEL"
>
<option value="1">JON</option>
<option value="0">JOFF</option>
</field>
When the form is rendered it will show something like:
Now fields also support that the same field can be rendered using different layouts just adding layout="mylibrary.field.name"
. That increases fields reusability because you can, for example, use a text field to add a currency value, an AJAX field, etc.
Example:
<field name="lineNumbers" type="radio"
class="btn-group btn-group-yesno"
default="0"
layout="mylibrary.field.radio"
filter="options"
description="PLG_CODEMIRROR_FIELD_LINENUMBERS_DESC"
label="PLG_CODEMIRROR_FIELD_LINENUMBERS_LABEL"
>
<option value="1">JON</option>
<option value="0">JOFF</option>
</field>
This PR changes internal behavior of fields. So:
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
I have removed the commit that removes the JLayout HTML comments from here. I will submit a new PR so we can merge it for v3.5
Tests passed now
Milestone |
Added: |
Category | ⇒ | Libraries |
This PR has received new commits.
CC: @dgt41
Ok. This is what I did:
class
& labelclass
to layoutsclasses
value for their layoutsI think this is the best we can do now.
If the layouts are new we can get away with it. Let me just check but I think they are new for 3.5 - if so then we can get away with it I guess
Nice now I have to redo the other PRs
yes!
This PR has received new commits.
CC: @dgt41
I have tested this item successfully on 92225ca
Works good. I have tested this in combination with the other PRs by @dgt41 and can confirm that the radio and checkboxes (codemirror) in Backend still works. Thanks
I have tested this item successfully on 92225ca
Status | Pending | ⇒ | Ready to Commit |
Easy | No | ⇒ | Yes |
RTC. Thanks.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-11-04 15:07:40 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
Merged - thanks guys
A hug thank you goes to @phproberto That is great stuff!
Thanks to everybody involved in testing, commenting, improving and merging
Thank you @phproberto for your contribution.
I have tested this item successfully on ff2f830
Core front end, back end, 3pd components all ok!
Updated the 3 fields PRs to get in-line with this
Thanks @phproberto
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8248.