J3 Issue ?
avatar ayazbaloch
ayazbaloch
2 Jul 2019

shown attribute does not work if fields render through foreach loop such as

form->getFieldset() as $field): ?>
      <div class="control-group">
                     <div class="control-label"><?php **echo $field->label;** ?></div>
                    <div class="controls"><?php **echo $field->input;** ?></div>
                    </div>

while it works when fields render such as form->renderField('fieldname'); ?>

Why this should be fixed

How would you fix it

Side Effects expected

avatar ayazbaloch ayazbaloch - open - 2 Jul 2019
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jul 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Jul 2019
avatar ayazbaloch ayazbaloch - change - 2 Jul 2019
The description was changed
avatar ayazbaloch ayazbaloch - edited - 2 Jul 2019
avatar ayazbaloch ayazbaloch - change - 2 Jul 2019
The description was changed
avatar ayazbaloch ayazbaloch - edited - 2 Jul 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 Jul 2019

Which Version?

avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Jul 2019
Status New Information Required
avatar SharkyKZ
SharkyKZ - comment - 2 Jul 2019

I think this is expected behavior at the moment. If you're rendering input and label manually, you also have to handle showon. See this for example:

<?php $dataShowOn = ''; ?>
<?php if ($field->showon) : ?>
<?php JHtml::_('jquery.framework'); ?>
<?php JHtml::_('script', 'jui/cms.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $dataShowOn = " data-showon='" . json_encode(JFormHelper::parseShowOnConditions($field->showon, $field->formControl, $field->group)) . "'"; ?>
<?php endif; ?>
<div class="js-stools-field-filter"<?php echo $dataShowOn; ?>>

avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Jul 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 2 Jul 2019
avatar richard67
richard67 - comment - 2 Jul 2019

SharkyKZ is correct. I think this issue can be closed as expected behavior. No need for more info about version.

avatar Quy Quy - close - 2 Jul 2019
avatar Quy Quy - change - 2 Jul 2019
Status Information Required Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2019-07-02 20:52:44
Closed_By Quy
avatar ayazbaloch
ayazbaloch - comment - 2 Jul 2019

Thanks dear @SharkyKZ for elaborating it.

avatar ayazbaloch
ayazbaloch - comment - 3 Jul 2019

Dear @SharkyKZ , I think this should be mentioned in Joomla Document.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Jul 2019

@ayazbaloch JDoc is a wiki, so please append the wanted Information, thanks.

avatar ayazbaloch
ayazbaloch - comment - 3 Jul 2019

Thanks @franz-wohlkoenig for guiding.

Add a Comment

Login with GitHub to post a comment