0

I'm trying to populate a tableselect on a form of a custom module. The tableselect is actually visible, but it's displaying the #empty message. I've simplified it to this code:

$form['my_module_overview'] = array(
    '#type' => 'tableselect',
    '#header' => array('parent' => t('Parent'), 'child' => t('Child')),
    '#options' => array(
        1 => array('parent' => 'test1', 'child' => 'test2'), 
        2 => array('parent' => 'test3', 'child' => 'test4')),
    '#empty' => t('There are no relationships defined yet.'),
    '#multiple' => TRUE,
);

So I'm seeing the table with the correct headers, but with the message "There are no ...".

I think I'm donig it correct, as the options array contains key-value-pairs with the values being arrays again. And those arrays have the header keys as keys ('parent' and 'child').

So how can I get the data to become visible in my tableselect?

1 Answer 1

0

Apparently, something is/was cached because clearing the cache solved it. So there weren't any problems with the code.

1
  • Not sure why the downvote, I had actually searched on this problem for quite a while, and in desperation tried this. Suddenly it worked...
    – Peter
    Commented Aug 5, 2014 at 9:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.