1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1680 Views |
-
Form Action doesn't work

3 June 2010 at 9:24pm
Hello,
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.
My JobsPage.php: http://pastebin.com/3dMt8QwX
My JobsPage.ss: http://pastebin.com/5iiUG4sU -
Re: Form Action doesn't work

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.
-
Re: Form Action doesn't work

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.
-
Re: Form Action doesn't work

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 (
'ShowJob'
);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
-
Re: Form Action doesn't work

27 September 2010 at 10:37am
Hi Vladas
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?Cheers
Tama
| 1680 Views | ||
|
Page:
1
|
Go to Top |



