2011 Posts in 1436 Topics by 620 members
|Go to End|
3 June 2010 at 9:24pm
I have a problem with my forms. When form is submitted, I can't get my doApply() method be executed. I've tried different approaches in creating my form - subclassing as well, but still no luck. If I add doApply() to $allowed_actions and execute it through URL, it prints me out "Hello" on a blank page. But with form, it prints me out "Page not found". What is a problem here? Is it a bug in SilverStripe? Thank you.
4 June 2010 at 3:01am
4 June 2010 at 12:02pm
Your code looks pretty good, only thing that strikes me you might need to test is remove the showjob function. Perhaps this is causing it issues as when you submit the form it may be calling the ShowJob function as well but without the ID set therefore not returning a form object.
Try a simplier case (like remove that whole showjobs function) and see if that works.
8 June 2010 at 12:00am
Tried to remove it, but still the same thing.
Actually, I can't remove ShowJob() as I will use this to generate a page where my apply form will be stored for each dataobject.
8 June 2010 at 12:20am Last edited: 8 June 2010 12:27am
Hmm, found out that this is stopping it from working. If I remove it - starts to work
static $allowed_actions = array (
Problem is - I need to have ShowJob as allowed action as I use it to call out a job entry and there is my form displayed. I also tried adding 'doApply', but also without luck.
Edit: Weird, just needed to remove it and everything works fine
27 September 2010 at 10:37am
I'm having a similar problem and am after some clarification for your fix.
Do you now have an empty $allow_actions statement:
static $allowed_actions = array(
or have you removed it altogether from the Page Controller extension?
|Go to Top|