10375 Posts in 2190 Topics by 1707 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 614 Views |
-
Multiform and conditional/dynamic fields

24 November 2010 at 9:05pm Last edited: 24 November 2010 9:06pm
Hi,
in my MultiForm Step i need fields dependend on the previous step.
Example:
Let's assume we have 2 DataObject classes:
1. Category (has_many Article)
2. Article (has_one Category)Step1 shows checkboxes of categories.
Step 2 should bring up a checkboxfieldset of all Articles having the CategoryID selected in the first step.I thought i can access the form data inside the method getFields() in Step2
function getFields() {
$data = $this->loadData();
Debug::dump($data);
}but the debug output is an empty array.
(I also checked the database: all selected CategoryIDs are save correctly. When using the previous button of MultiForm the checkboxes of the first step are also populated correctly)
Any ideas ?
Greetings,
Rob
-
Re: Multiform and conditional/dynamic fields

24 November 2010 at 9:25pm Last edited: 24 November 2010 9:43pm
I created a workaround:
function getFields() {
$step = DataObject::get_one(
'MultiFormStep',
"SessionID ={$this->Session()->ID} AND ClassName='ProposalTemplateForm_Step1'"
);
if($step) {
$data = $step->loadData();
}
....}
| 614 Views | ||
|
Page:
1
|
Go to Top |

