? Success

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
5 Dec 2016

Pull Request for PR #13069.

Summary of Changes

The label of the field is show in the table layout of the subform field as column header and then inline before the input field
This PR shows the label beside the input field only when the fields itself should be grouped by its groups.

Testing Instructions

Put the following XML code into the file administrator/components/com_content/models/forms/article.xml after line 162 (inside the basic fieldset in the attribs tag).

<field name="demo" type="subform" label="Subform" multiple="true" layout="joomla.form.field.subform.repeatable-table">
	<form>
		<field name="name"
			label="Name"
			size="30" type="text" />

		<field name="value"
			label="Value"
			size="30" type="text" />
	</form>
</field>

Expected result

The labels should not be shown in the cell, like
image

Actual result

The labels are shown.
image

avatar laoneo laoneo - open - 5 Dec 2016
avatar laoneo laoneo - change - 5 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Dec 2016
Category Layout
avatar brianteeman
brianteeman - comment - 7 Dec 2016

I have tested this item successfully on eac64ae


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13093.

avatar brianteeman brianteeman - test_item - 7 Dec 2016 - Tested successfully
avatar brianteeman brianteeman - change - 8 Dec 2016
Easy No Yes
avatar Fedik
Fedik - comment - 8 Dec 2016

now I remember why was need $field->renderField(), it need for showon feature,

maybe we can do something like $field->renderField(array('label' => false)),
but cannot check currently

avatar ralain
ralain - comment - 8 Dec 2016

I have tested this item successfully on eac64ae


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13093.

avatar ralain ralain - test_item - 8 Dec 2016 - Tested successfully
avatar jeckodevelopment jeckodevelopment - change - 9 Dec 2016
Status Pending Ready to Commit
avatar jeckodevelopment
jeckodevelopment - comment - 9 Dec 2016

Rtc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13093.

avatar Fedik
Fedik - comment - 9 Dec 2016

please hold on,
need to test showon feature,
for it can use xml from #12511 with layout="joomla.form.field.subform.repeatable-table" or:

<field name="items" type="subform"  multiple="true"  label="Subform Field" 
layout="joomla.form.field.subform.repeatable-table" >
  <form>
    <field name="type" type="list" default="0" label="Type" >
        <option value="0">Small</option>
        <option value="1">Medium</option>
        <option value="2">Large</option>
       </field>

        <field name="something"  type="text"
            label="Show when Type=Large" showon="type:2" />
   </form>
</field>

I cannot currently, maybe this evening or tomorrow

avatar laoneo
laoneo - comment - 9 Dec 2016

Just tested it and showon is not working. Thanks for having a look @Fedik !!

avatar brianteeman brianteeman - change - 9 Dec 2016
Milestone Added:
avatar jeckodevelopment jeckodevelopment - change - 9 Dec 2016
Status Ready to Commit Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Dec 2016
Milestone Removed:
avatar Fedik
Fedik - comment - 10 Dec 2016

hm, $field->renderField(array('hiddenLabel' => true)); partially do the thing,
but default Joomla! styling add .form-horizontal .controls {margin-left: 180px;} for input.
No idea what the best solution here

avatar laoneo
laoneo - comment - 13 Dec 2016

@Fedik resetting the margin left with b83801e, what do you think?

avatar Fedik
Fedik - comment - 13 Dec 2016

looks as good idea ?

avatar laoneo
laoneo - comment - 15 Dec 2016

Can this being tested again, with the following XML code, thanks!!

<field name="items" type="subform"  multiple="true"  label="Subform Field"
	layout="joomla.form.field.subform.repeatable-table" >
	<form>
		<field name="type" type="list" default="0" label="Type" >
			<option value="0">Small</option>
			<option value="1">Medium</option>
			<option value="2">Large</option>
		</field>
		<field name="something"  type="text"
			label="Show when Type=Large" showon="type:2" />
	</form>
</field>

The show on functionality should work as well.

avatar ralain
ralain - comment - 18 Dec 2016

@laoneo Left margin reset isn't working right now because the data-group attribute is being modified when we insert rows. Perhaps target data-base-name, instead? That should be the same for each row.

avatar Fedik
Fedik - comment - 18 Dec 2016

I have tested and it not realy work, @ralain are right,
but there one more thing, this code add CSS multiple times.
So maybe better place:

JFactory::getDocument()->addStyleDeclaration(
  '.subform-repeatable-group[data-base-name="' . $fieldname . '"] .controls { margin-left: 0px }'
);

in the repeatable-table.php somewhere after this line repeatable-table.php#L62

Other possible solution is to add specific class to <div class="subform-repeatable-wrapper subform-table-layout"> and use CSS file to styling:

<div class="subform-repeatable-wrapper subform-table-layout subform-table-sublayout-<?php echo $sublayout; ?>">

and in css:

.subform-table-sublayout-section .controls { margin-left: 0px }
avatar ralain
ralain - comment - 18 Dec 2016

Other possible solution is to add specific class to <div class="subform-repeatable-wrapper subform-table-layout"> and use CSS file to stylig.

Indeed, I would personally prefer a single global css rule over the embedded styles, if possible.

avatar laoneo
laoneo - comment - 21 Dec 2016

Changed to your suggestion, thanks for your help, much appreciated.

avatar Fedik
Fedik - comment - 21 Dec 2016

only, please move addStyleDeclaration() in to the repeatable-table.php somewhere after this line repeatable-table.php#L62 , because in current place it will be added multiple times

avatar laoneo
laoneo - comment - 22 Dec 2016

Done, should work now

avatar laoneo
laoneo - comment - 23 Dec 2016

Can we have another round of testing please. Thanks.

avatar zero-24 zero-24 - change - 23 Dec 2016
Milestone Added:
avatar Fedik
Fedik - comment - 23 Dec 2016

I have tested this item successfully on a272243


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13093.

avatar Fedik Fedik - test_item - 23 Dec 2016 - Tested successfully
avatar ralain
ralain - comment - 23 Dec 2016

I have tested this item successfully on a272243


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13093.

avatar ralain ralain - test_item - 23 Dec 2016 - Tested successfully
avatar joomla-cms-bot joomla-cms-bot - change - 23 Dec 2016
Milestone Removed:
avatar jeckodevelopment jeckodevelopment - change - 23 Dec 2016
Status Pending Ready to Commit
avatar jeckodevelopment
jeckodevelopment - comment - 23 Dec 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13093.

avatar jeckodevelopment jeckodevelopment - change - 23 Dec 2016
Milestone Added:
avatar zero-24 zero-24 - reference | eb5d85f - 23 Dec 16
avatar zero-24 zero-24 - merge - 23 Dec 2016
avatar zero-24 zero-24 - close - 23 Dec 2016
avatar zero-24 zero-24 - change - 23 Dec 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-12-23 16:57:35
Closed_By zero-24
Labels Added: ?
avatar zero-24 zero-24 - close - 23 Dec 2016
avatar zero-24 zero-24 - merge - 23 Dec 2016
avatar zero-24
zero-24 - comment - 23 Dec 2016

Merged thanks

Add a Comment

Login with GitHub to post a comment