Ok, I'm running into a little issue.
I'm having a custom form (new Form(Fields, Actions etc.. ), which uses a custom subclass of Form (MyForm extends Form).
This form also uses MyValidator, which is a subclass of RequiredFields.
Now, in this validator I'm throwing a validation error and setting a session var, which I access in the __construct method of MyForm. If this session var is there, I'm pushing a new Field to the form, in the constructor method of the form class, put simply:
class MyForm extends Form{
function __construct(){
if (session) $fields->push(...);
}
}
So far everything works.
The page is redirectedBack, with the new Field added to the existing form.
Then in MyValidator, I want to check if this new field is there - based upon this the validation will change. However - I'm not able to detect this field, only the fields I created initially on my controller are accessible through $data/ $this->form->Fields()->datafieldbyName("MyField").
Neither is this field's custom validation working.
The only thing I can do is access the value through $_REQUEST[], but not with any of the available SS methods.
Any hints? I really want to detect if the new field is there.
PS: I noticed the securityfield is 'pushed' in the same way in the form class, and doesn't seem to be accessible either.