17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1575 Views |
-
Trouble making a form with a CheckboxSetField

26 August 2007 at 10:30pm
Hey there,
I'm trying to create a extended search form to search in one of my modules. But as soon as i create a CheckboxSetField i get the error : Fatal error: Call to a member function hasMethod() on a non-object in /var/www/empex4/sapphire/forms/CheckboxSetField.php on line 21
I really can't figure out why this happends. I've shrinked the form to virtually nothing and still i get the same error. Here's my code :
class VacatureUitgebreidZoeken extends Page {
static $db = array(
);
static $has_one = array(
);
}class VacatureUitgebreidZoeken_Controller extends Page_Controller {
function VacatureSearchForm() {
// Create fields
$test = new CheckboxSetField('Werkstatus','Werkstatus',array('Fulltime' => 'Fulltime',
'Parttime' => 'Parttime',
'Oproepbasis' => 'Oproepbasis'));
$fields = new FieldSet(
$test
);
$submitAction = new FormAction('uitgebreidZoekenResults', 'Resultaten weergeven');
$actions = new FieldSet(
$submitAction
);
$form = new Form($this, 'VacatureSearchForm', $fields, $actions
);
return $form;
}
}anyone knows what to do?
Thanks!
-
Re: Trouble making a form with a CheckboxSetField

27 August 2007 at 10:47am Last edited: 27 August 2007 10:53am
The problem technically is hasMethod shouldn't be called if the record doesn't exist. And it appears to have been fixed here:
You can add the extra check for $record to your CheckboxSetField.php file to resolve it.
Cheers!
Sean
-
Re: Trouble making a form with a CheckboxSetField

27 August 2007 at 6:23pm
Great! That worked!
I was checking rechecking and doing more checking, did it seem to be a framework failure!
Tnx for the solution!
-
Re: Trouble making a form with a CheckboxSetField

27 August 2007 at 8:47pm
No problems,
It looks like someone already ran into the same problem you had and resolved it. This fix will appear in the next release of the SS framework.
Thanks for pointing it out!
Cheers,
Sean
| 1575 Views | ||
|
Page:
1
|
Go to Top |


