[SOLVED] Picklist Element in custom Detail Form Template doesn't work + Solution

marcq

Member
Hi,

I have created a custom detail form template.

I have created a Picklist element and added the following query in the Eval populate field.

Code:
$bookingid = JRequest::getVar('rowid');

$mydb = JFactory::getDbo();

$mydb->setQuery("SELECT id, nom FROM fab_crew");
$myrows = $mydb->loadObjectList();
foreach ($myrows as $row) {
$options[] = JHTML::_('select.option', $row->id, $row->nom);
}
return $options;

In my custom detail form template I added the following code to display my Picklist element :

Code:
$equipage = $this->groups['Cahier de service - Patron - Equipage'];
$elementsequipage = $equipage->elements;


$crewmember = $elementsequipage['book_crewmember']->element;

Code:
                <tr>
                    <td>Equipage</td>
                    <td colspan="2"></td>
                    <td colspan="3"><?php echo $crewmember; ?>&nbsp;</td>
                    <td colspan="3">Parcours</td>
                </tr>

I'm unable to drag an element from "Bacounis" to "Equipage".

I've checked the access rights which are ok.

http://www.screencast.com/t/kuMYFuhc

and I've got the following error

Code:
Uncaught TypeError: a.getElement is not a function picklist-min.js:2

displayed in my debug console.

Thank you in advance for your support.

Cheers,

Marc

ps: last Joomla version
last Fabrik github
 
Does it work with just the "eval populate" in a standard template?

I suspect it's because you aren't including the container markup. Have a look at a standard template output and you'll see the container div markup that needs to be wrapped around the element markup.

-- hugh
 
Does it work with just the "eval populate" in a standard template?

I suspect it's because you aren't including the container markup. Have a look at a standard template output and you'll see the container div markup that needs to be wrapped around the element markup.

-- hugh
Thanks a lot Hugh, I learned something more, it is working like a charm.

Code:
<div class="fabrikElementContainer"><?php echo $crewmember; ?></div>

Cheers, Marc

PS Hugh : A last question : do I need to wrap every elements by creating a new custom form template ?
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top