[turba] Radio buttons, checkboxes, pulldown lists in Turba, some test results
Eric
spamsink at scoot.netis.com
Sat Nov 25 13:01:07 PST 2006
I set up a test machine with a throwaway database on which I could test
some of my wild guesses as to how to make this work.
In the turba_objects table in the horde database I made a couple of new
objects:
object_isCheckedInt int(11)
object_isCheckedChar varchar(20)
I created them with:
alter table turba_objects add column object_isCheckedInt int;
alter table turba_objects add column object_isCheckedChar varchar(20);
(For some reason, the int showed up with an attribute of 11, which I assume
means it's 11 bytes long, not sure why that happened that way, maybe 11
bytes is the minimum size for an int in MySQL.)
In attributes.php I added:
$attributes['testcheck1'] = array(
'label' => 'Test Checkbox 1',
'type' => 'checkbox',
'required' => false
);
$attributes['testcheck2'] = array(
'label' => 'Test Checkbox 2',
'type' => 'checkbox',
'required' => false
);
In sources.php I added within the 'map' => array() block:
'testcheck1' => 'object_isCheckedInt',
'testcheck2' => 'object_isCheckedChar',
Clicked on "New Contact" in Turba and got:
A fatal error has occurred.
Nonexistant class "Horde_Form_Type_checkbox" for field type "checkbox".
Details have been logged for the administrator.
(First of all, where are the "details ... logged for the
administrator"? I've gotten that message before, usually in response to
some boneheaded move of mine, and haven't been able to find where the
details are logged.)
So, checkboxes didn't work as I expected, so I tried radio buttons.
Changed the testcheck1 and testcheck2 attributes in attributes.php to read:
$attributes['testcheck1'] = array(
'label' => 'Test Checkbox 1',
'type' => 'radio',
'required' => false,
'params' => array('IsFalse', 'IsTrue')
);
$attributes['testcheck2'] = array(
'label' => 'Test Checkbox 2',
'type' => 'radio',
'required' => false,
'params' => array('IsFalse', 'IsTrue')
);
Clicked on "New Contact" and at the bottom of the New Contact form I got
the two labels "Test Checkbox 1" and "Test Checkbox 2", but no radio
buttons or "IsFalse" or "IsTrue" labels.
So, radio buttons don't work as I guessed they might, either.
Batting zero so far... :-(
More information about the turba
mailing list