Layout Issue - Custom Lookup Field #9

Closed
opened 2016-07-09 01:20:13 +00:00 by mwweb · 11 comments
mwweb commented 2016-07-09 01:20:13 +00:00 (Migrated from github.com)

I created some lookup fields, to pull information form other tables, using your example from demo content. My fields are City (from a cities view), State (from a states view), and Country (from a countries view). When I look at the view, lookup fields are right next to each other, rather than in separate rows. I have checked, and the fields are set to Left in Tab, and the order is set correctly. I have noticed that if I place a non-lookup field between the 2 lookups, then it lays out correctly.
screenshot_fri_jul_08_18 10 19

I created some lookup fields, to pull information form other tables, using your example from demo content. My fields are City (from a cities view), State (from a states view), and Country (from a countries view). When I look at the view, lookup fields are right next to each other, rather than in separate rows. I have checked, and the fields are set to Left in Tab, and the order is set correctly. I have noticed that if I place a non-lookup field between the 2 lookups, then it lays out correctly. ![screenshot_fri_jul_08_18 10 19](https://cloud.githubusercontent.com/assets/19194012/16705248/968f5b00-4538-11e6-86ab-0fac8142f531.png)

hmm this sound weird, I have not had this issue....

Okay lets see you want them all lined up Left in Tab do me a favor, just check if you did not by accident selected Left of Tab for some? Since that has happed to me.. but if not, lets look at the code. Post the code from the edit.php file here if you don't mind.... then I can tell you what is happening.

hmm this sound weird, I have not had this issue.... Okay lets see you want them all lined up **Left in Tab** do me a favor, just check if you did not by accident selected **Left of Tab** for some? Since that has happed to me.. but if not, lets look at the code. Post the code from the **edit.php** file here if you don't mind.... then I can tell you what is happening.
mwweb commented 2016-07-11 17:50:24 +00:00 (Migrated from github.com)

They are all Left In Tab.

screenshot_mon_jul_11_10 46 10

Below is the PHP from edit.php. Now, if I add something to right in tabs, then it positions everything fine.

<?php
/*----------------------------------------------------------------------------------|  www.vdm.io  |----/
                Most Wanted Web Services, Inc. 
/-------------------------------------------------------------------------------------------------------/

    @version        2.0.0-Alpha1
    @build          11th July, 2016
    @created        11th July, 2016
    @package        Most Wanted Real Estate
    @subpackage     edit.php
    @author         Most Wanted Web Services, Inc. <http://mostwantedrealestatesites.com>
    @real estate advisor        Charlotte Snyder <http://mostwantedadvertising.com> 
    @copyright      Copyright (C) 2015-2016. All Rights Reserved
    @license        GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____  _____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \(  _  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/ )(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__)  (_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_mostwantedrealestate');
?>
<div id="mostwantedrealestate_loader">
<form action="<?php echo JRoute::_('index.php?option=com_mostwantedrealestate&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">

    <?php echo JLayoutHelper::render('property.main_details_above', $this); ?><div class="form-horizontal span9">

    <?php echo JHtml::_('bootstrap.startTabSet', 'propertyTab', array('active' => 'main_details')); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'main_details', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_MAIN_DETAILS', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.main_details_left', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'general', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_GENERAL', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span6">
                <?php echo JLayoutHelper::render('property.general_left', $this); ?>
            </div>
            <div class="span6">
                <?php echo JLayoutHelper::render('property.general_right', $this); ?>
            </div>
        </div>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.general_fullwidth', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'features', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_FEATURES', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span6">
                <?php echo JLayoutHelper::render('property.features_left', $this); ?>
            </div>
            <div class="span6">
                <?php echo JLayoutHelper::render('property.features_right', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'commercial', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_COMMERCIAL', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span6">
                <?php echo JLayoutHelper::render('property.commercial_left', $this); ?>
            </div>
            <div class="span6">
                <?php echo JLayoutHelper::render('property.commercial_right', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'multifamily', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_MULTIFAMILY', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.multifamily_left', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'farmranch', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_FARMRANCH', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.farmranch_left', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'rentals', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_RENTALS', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span6">
                <?php echo JLayoutHelper::render('property.rentals_left', $this); ?>
            </div>
            <div class="span6">
                <?php echo JLayoutHelper::render('property.rentals_right', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'media', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_MEDIA', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.media_left', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'open_houses', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_OPEN_HOUSES', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.open_houses_left', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'financial', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_FINANCIAL', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.financial_left', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'area_info', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_AREA_INFO', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.area_info_left', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>

    <?php if ($this->canDo->get('core.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.state') || $this->canDo->get('core.edit.created')) : ?>
    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'publishing', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_PUBLISHING', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span6">
                <?php echo JLayoutHelper::render('property.publishing', $this); ?>
            </div>
            <div class="span6">
                <?php echo JLayoutHelper::render('property.metadata', $this); ?>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>
    <?php endif; ?>

    <?php if ($this->canDo->get('core.admin')) : ?>
    <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'permissions', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_PERMISSION', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <fieldset class="adminform">
                    <div class="adminformlist">
                    <?php foreach ($this->form->getFieldset('accesscontrol') as $field): ?>
                        <div>
                            <?php echo $field->label; echo $field->input;?>
                        </div>
                        <div class="clearfix"></div>
                    <?php endforeach; ?>
                    </div>
                </fieldset>
            </div>
        </div>
    <?php echo JHtml::_('bootstrap.endTab'); ?>
    <?php endif; ?>

    <?php echo JHtml::_('bootstrap.endTabSet'); ?>

    <div>
        <input type="hidden" name="task" value="property.edit" />
        <?php echo JHtml::_('form.token'); ?>
    </div>
</div><div class="span3">
    <?php echo JLayoutHelper::render('property.main_details_rightside', $this); ?>
</div>
</form>
</div>
They are all Left In Tab. ![screenshot_mon_jul_11_10 46 10](https://cloud.githubusercontent.com/assets/19194012/16740622/c41fd3ce-4754-11e6-956b-98ab54780cb4.png) Below is the PHP from edit.php. Now, if I add something to right in tabs, then it positions everything fine. ``` <?php /*----------------------------------------------------------------------------------| www.vdm.io |----/ Most Wanted Web Services, Inc. /-------------------------------------------------------------------------------------------------------/ @version 2.0.0-Alpha1 @build 11th July, 2016 @created 11th July, 2016 @package Most Wanted Real Estate @subpackage edit.php @author Most Wanted Web Services, Inc. <http://mostwantedrealestatesites.com> @real estate advisor Charlotte Snyder <http://mostwantedadvertising.com> @copyright Copyright (C) 2015-2016. All Rights Reserved @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____ (_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _) .-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )( \____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__) /------------------------------------------------------------------------------------------------------*/ // No direct access to this file defined('_JEXEC') or die('Restricted access'); JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = JComponentHelper::getParams('com_mostwantedrealestate'); ?> <div id="mostwantedrealestate_loader"> <form action="<?php echo JRoute::_('index.php?option=com_mostwantedrealestate&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data"> <?php echo JLayoutHelper::render('property.main_details_above', $this); ?><div class="form-horizontal span9"> <?php echo JHtml::_('bootstrap.startTabSet', 'propertyTab', array('active' => 'main_details')); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'main_details', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_MAIN_DETAILS', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.main_details_left', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'general', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_GENERAL', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span6"> <?php echo JLayoutHelper::render('property.general_left', $this); ?> </div> <div class="span6"> <?php echo JLayoutHelper::render('property.general_right', $this); ?> </div> </div> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.general_fullwidth', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'features', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_FEATURES', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span6"> <?php echo JLayoutHelper::render('property.features_left', $this); ?> </div> <div class="span6"> <?php echo JLayoutHelper::render('property.features_right', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'commercial', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_COMMERCIAL', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span6"> <?php echo JLayoutHelper::render('property.commercial_left', $this); ?> </div> <div class="span6"> <?php echo JLayoutHelper::render('property.commercial_right', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'multifamily', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_MULTIFAMILY', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.multifamily_left', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'farmranch', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_FARMRANCH', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.farmranch_left', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'rentals', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_RENTALS', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span6"> <?php echo JLayoutHelper::render('property.rentals_left', $this); ?> </div> <div class="span6"> <?php echo JLayoutHelper::render('property.rentals_right', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'media', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_MEDIA', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.media_left', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'open_houses', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_OPEN_HOUSES', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.open_houses_left', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'financial', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_FINANCIAL', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.financial_left', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'area_info', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_AREA_INFO', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.area_info_left', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php if ($this->canDo->get('core.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.state') || $this->canDo->get('core.edit.created')) : ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'publishing', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_PUBLISHING', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span6"> <?php echo JLayoutHelper::render('property.publishing', $this); ?> </div> <div class="span6"> <?php echo JLayoutHelper::render('property.metadata', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php endif; ?> <?php if ($this->canDo->get('core.admin')) : ?> <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'permissions', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_PERMISSION', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <fieldset class="adminform"> <div class="adminformlist"> <?php foreach ($this->form->getFieldset('accesscontrol') as $field): ?> <div> <?php echo $field->label; echo $field->input;?> </div> <div class="clearfix"></div> <?php endforeach; ?> </div> </fieldset> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php endif; ?> <?php echo JHtml::_('bootstrap.endTabSet'); ?> <div> <input type="hidden" name="task" value="property.edit" /> <?php echo JHtml::_('form.token'); ?> </div> </div><div class="span3"> <?php echo JLayoutHelper::render('property.main_details_rightside', $this); ?> </div> </form> </div> ```

Okay lets see, you have a few tabs here...

This is tab 1

<?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'main_details', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_MAIN_DETAILS', true)); ?>
        <div class="row-fluid form-horizontal-desktop">
            <div class="span12">
                <?php echo JLayoutHelper::render('property.main_details_left', $this); ?>
            </div>
        </div>
<?php echo JHtml::_('bootstrap.endTab'); ?>

So as you can see it only loads one layout called property.main_details_left

This should mean that all is being loaded to the left.....

Okay give me some time (few hours) I will try and duplicate this and see what I find, it may be a bug... and then I will fix it.

Okay lets see, you have a few tabs here... This is tab 1 ``` <?php echo JHtml::_('bootstrap.addTab', 'propertyTab', 'main_details', JText::_('COM_MOSTWANTEDREALESTATE_PROPERTY_MAIN_DETAILS', true)); ?> <div class="row-fluid form-horizontal-desktop"> <div class="span12"> <?php echo JLayoutHelper::render('property.main_details_left', $this); ?> </div> </div> <?php echo JHtml::_('bootstrap.endTab'); ?> ``` So as you can see it only loads one layout called **property.main_details_left** This should mean that all is being loaded to the left..... Okay give me some time (few hours) I will try and duplicate this and see what I find, it may be a bug... and then I will fix it.

Okay So I tried to duplicate the issue but was not successful

left_fields

It lines up correctly, so this means it is not a bug. What we now need to do is ask a few questions.

  1. Does this view have custom scripting in any field or in any tab?
  2. The field that shows up on the right have you checked if you place another field in its place if it still moves over?
  3. Is this component on github so I can look at it?
Okay So I tried to duplicate the issue but was not successful ![left_fields](https://cloud.githubusercontent.com/assets/5607939/16745031/f5a39190-47ab-11e6-90b2-e76b2a72026f.png) It lines up correctly, so this means it is not a bug. What we now need to do is ask a few questions. 1. Does this view have custom scripting in any field or in any tab? 2. The field that shows up on the right have you checked if you place another field in its place if it still moves over? 3. Is this component on github so I can look at it?
mwweb commented 2016-07-11 21:06:32 +00:00 (Migrated from github.com)
  1. They are using custom field types, which I will paste 2 examples below.
  2. If, as an example, I have City, then State city and state show on the same line. But, if I put a text or radio field in between them, or I place something "Right in Tabs" then it lays out fine.
  3. At present I don't have it in GitHub.
<field 
    type="cities" 
    name="cityid" 
    label="City" 
    description="Select the city." 
    class="list_class" 
    multiple="false" 
    default="0" 
    required="" 
    readonly="" 
    disabled="" 
    extends="list" 
    button="true" 
    table="#__###component###_city" 
    component="com_###component###" 
    view="city" 
    views="cities" 
    value_field="name" 
    key_field="id" 
    type_php_1="$db = JFactory::getDBO();" 
    type_php_2="$query = $db->getQuery(true);" 
    type_php_3="$query->select($db->quoteName(array('a.###ID###','a.###TEXT###'),array('###ID###','###CODE_TEXT###')));" 
    type_php_4="$query->from($db->quoteName('###TABLE###', 'a'));" 
    type_php_5="$query->where($db->quoteName('a.published') . ' = 1');" 
    type_php_6="$query->order('a.###TEXT### ASC');" 
    type_php_7="$db->setQuery((string)$query);" 
    type_php_8="$items = $db->loadObjectList();" 
    type_php_9="$options = array();" 
    type_php_10="if ($items)" 
    type_php_11="{" 
    type_php_12="\t$options[] = JHtml::_('select.option', '', 'Select a city');" 
    type_php_13="\tforeach($items as $item)" 
    type_php_14="\t{" 
    type_php_15="\t\t$options[] = JHtml::_('select.option', $item->###ID###, $item->###CODE_TEXT###);" 
    type_php_16="\t}" 
    type_php_17="}" 
    type_php_18="" 
    type_php_19="return $options;" 
/>

<field 
    type="states" 
    name="stateid" 
    label="State" 
    description="Select the State." 
    class="list_class" 
    multiple="false" 
    default="0" 
    required="" 
    readonly="" 
    disabled="" 
    extends="list" 
    button="true" 
    table="#__###component###_state" 
    component="com_###component###" 
    view="state" 
    views="states" 
    value_field="name" 
    key_field="id" 
    type_php_1="$db = JFactory::getDBO();" 
    type_php_2="$query = $db->getQuery(true);" 
    type_php_3="$query->select($db->quoteName(array('b.###ID###','b.###TEXT###'),array('###ID###','###CODE_TEXT###')));" 
    type_php_4="$query->from($db->quoteName('###TABLE###', 'b'));" 
    type_php_5="$query->where($db->quoteName('b.published') . ' = 1');" 
    type_php_6="$query->order('b.###TEXT### ASC');" 
    type_php_7="$db->setQuery((string)$query);" 
    type_php_8="$items = $db->loadObjectList();" 
    type_php_9="$options = array();" 
    type_php_10="if ($items)" 
    type_php_11="{" 
    type_php_12="\t$options[] = JHtml::_('select.option', '', 'Select a state');" 
    type_php_13="\tforeach($items as $item)" 
    type_php_14="\t{" 
    type_php_15="\t\t$options[] = JHtml::_('select.option', $item->###ID###, $item->###CODE_TEXT###);" 
    type_php_16="\t}" 
    type_php_17="}" 
    type_php_18="" 
    type_php_19="return $options;" 
/>
1. They are using custom field types, which I will paste 2 examples below. 2. If, as an example, I have City, then State city and state show on the same line. But, if I put a text or radio field in between them, or I place something "Right in Tabs" then it lays out fine. 3. At present I don't have it in GitHub. ``` <field type="cities" name="cityid" label="City" description="Select the city." class="list_class" multiple="false" default="0" required="" readonly="" disabled="" extends="list" button="true" table="#__###component###_city" component="com_###component###" view="city" views="cities" value_field="name" key_field="id" type_php_1="$db = JFactory::getDBO();" type_php_2="$query = $db->getQuery(true);" type_php_3="$query->select($db->quoteName(array('a.###ID###','a.###TEXT###'),array('###ID###','###CODE_TEXT###')));" type_php_4="$query->from($db->quoteName('###TABLE###', 'a'));" type_php_5="$query->where($db->quoteName('a.published') . ' = 1');" type_php_6="$query->order('a.###TEXT### ASC');" type_php_7="$db->setQuery((string)$query);" type_php_8="$items = $db->loadObjectList();" type_php_9="$options = array();" type_php_10="if ($items)" type_php_11="{" type_php_12="\t$options[] = JHtml::_('select.option', '', 'Select a city');" type_php_13="\tforeach($items as $item)" type_php_14="\t{" type_php_15="\t\t$options[] = JHtml::_('select.option', $item->###ID###, $item->###CODE_TEXT###);" type_php_16="\t}" type_php_17="}" type_php_18="" type_php_19="return $options;" /> ``` --- ``` <field type="states" name="stateid" label="State" description="Select the State." class="list_class" multiple="false" default="0" required="" readonly="" disabled="" extends="list" button="true" table="#__###component###_state" component="com_###component###" view="state" views="states" value_field="name" key_field="id" type_php_1="$db = JFactory::getDBO();" type_php_2="$query = $db->getQuery(true);" type_php_3="$query->select($db->quoteName(array('b.###ID###','b.###TEXT###'),array('###ID###','###CODE_TEXT###')));" type_php_4="$query->from($db->quoteName('###TABLE###', 'b'));" type_php_5="$query->where($db->quoteName('b.published') . ' = 1');" type_php_6="$query->order('b.###TEXT### ASC');" type_php_7="$db->setQuery((string)$query);" type_php_8="$items = $db->loadObjectList();" type_php_9="$options = array();" type_php_10="if ($items)" type_php_11="{" type_php_12="\t$options[] = JHtml::_('select.option', '', 'Select a state');" type_php_13="\tforeach($items as $item)" type_php_14="\t{" type_php_15="\t\t$options[] = JHtml::_('select.option', $item->###ID###, $item->###CODE_TEXT###);" type_php_16="\t}" type_php_17="}" type_php_18="" type_php_19="return $options;" /> ```

Okay those scripts are almost still in default...

Well I can't really help you if I can't see it, I realize you would not want to just give your work away. But for me to debug this I have to see it.

Honestly it must just be a simple glitch, I know because I have spend tons of hours fixing those kind of stuff.... lol

You can try going over the generated code. Look at the layouts, remove some of the code in the edit view, like some of the tabs... and just break it. You can easy rebuild it in the CBuilder, right?.. so open the code and fiddle with it until you see it work and then let me know if you find something.

Only thing I can still think is it may be a one div to many somewhere. Yet in counting the divs above all seems okay, I counted 40 divs and they all close again. You could review that again.

I can tell you that I have build many components so far and have not yet had this issue, so it would be great if we can solve this edge case 👍

Keep me posted!

Okay those scripts are almost still in default... Well I can't really help you if I can't see it, I realize you would not want to just give your work away. But for me to debug this I have to see it. Honestly it must just be a simple glitch, I know because I have spend tons of hours fixing those kind of stuff.... lol You can try going over the generated code. Look at the layouts, remove some of the code in the edit view, like some of the tabs... and just break it. You can easy rebuild it in the CBuilder, right?.. so open the code and fiddle with it until you see it work and then let me know if you find something. Only thing I can still think is it may be a one div to many somewhere. Yet in counting the divs above all seems okay, I counted 40 divs and they all close again. You could review that again. I can tell you that I have build many components so far and have not yet had this issue, so it would be great if we can solve this edge case :+1: Keep me posted!
mwweb commented 2016-07-11 22:41:06 +00:00 (Migrated from github.com)

My live version that I have been working on today (and yesterday) is using the left and right in tab.

I have this "test" version with everything in left uploaded to git. Once we see IF it's a bug, then this code will, eventually, be updated to the current live version I'm developing off of.

The sample code that I have been providing is for the property view.

https://github.com/mwweb/most-wanted-real-estate

My live version that I have been working on today (and yesterday) is using the left and right in tab. I have this "test" version with everything in left uploaded to git. Once we see IF it's a bug, then this code will, eventually, be updated to the current live version I'm developing off of. The sample code that I have been providing is for the property view. https://github.com/mwweb/most-wanted-real-estate

Okay I see tones of errors.... you have many fields setup incorrectly in this view, do you have show errors turned on in your developers environment?

First off there is custom fields in this view that don't have the database table in place, so major error there #__mostwantedrealestate_rental_frequency

Then price has a field called showon you have the wrong details in it showon="show_price=0", please review documentation on the showon switch. It should be showon="show_price:0"

I think there is a few more with this same error, you should go over all those where you are using showon.

About the field showing on the wrong side, it is a css problem. I am looking at a way to fix it, I am using the input-append css class to bind the little button to the selection field and it is causing issues when there is two fields below each other were both is having these nice buttons... so you were right :)

Okay I will let you know soon as I have this resolved.

Okay I see tones of errors.... you have many fields setup incorrectly in this view, do you have show errors turned on in your developers environment? First off there is custom fields in this view that don't have the database table in place, so major error there `#__mostwantedrealestate_rental_frequency` Then price has a field called `showon` you have the wrong details in it `showon="show_price=0"`, please review documentation on the showon switch. It should be `showon="show_price:0"` I think there is a few more with this same error, you should go over all those where you are using showon. About the field showing on the wrong side, it is a css problem. I am looking at a way to fix it, I am using the `input-append` css class to bind the little button to the selection field and it is causing issues when there is two fields below each other were both is having these nice buttons... so you were right :) Okay I will let you know soon as I have this resolved.

Please update to version 2.1.16 as this should resolve the layout issue. Let me know.

Please update to version 2.1.16 as this should resolve the layout issue. Let me know.
mwweb commented 2016-07-12 21:19:17 +00:00 (Migrated from github.com)

the rental_frequency view was just added yesterday, and is actually in my "live" build, that has fields laid out different than what I uploaded to GitHub.

There is still a long ways to go in the continued development/rewrite of that component I took over. There were a lot of settings that were "hardcoded" in the component Options that I think should be more customizable (rental_frequency is one example of this).

the rental_frequency view was just added yesterday, and is actually in my "live" build, that has fields laid out different than what I uploaded to GitHub. There is still a long ways to go in the continued development/rewrite of that component I took over. There were a lot of settings that were "hardcoded" in the component Options that I think should be more customizable (rental_frequency is one example of this).

Sure.. I can see it has tones of values :)

Let me know one you have tested it with the new CB build.

Sure.. I can see it has tones of values :) Let me know one you have tested it with the new CB build.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#9
No description provided.