Modified:
/wiki/HowToPrefillFormFields.wiki
=======================================
--- /wiki/HowToPrefillFormFields.wiki Sat Apr 4 00:08:36 2009
+++ /wiki/HowToPrefillFormFields.wiki Thu Jan 6 09:15:46 2011
@@ -13,6 +13,24 @@
== The stepprocessor ==
With putting the stepprocessor as first element in your step, you can let
it prefill your fields with more information. You can - for example - take
the current steps information and use it for the selection of your prefill
values.
+
+For example in your forms defintion write:
+{{{
+<step postback="1">
+ <stepprocessor class="LoadDescriptionProcessor" />
+}}}
+
+And your processor:
+
+{{{
+class LoadDescriptionProcessor implements StepProcessor {
+ public function process(array $values, array $files, $currentStep,
$numberOfSteps) {
+ // TODO: some code to load your data into $description
+ // and then get the name of the formfield:
+
$_POST[BeanFactory::getBeanById("formProcessor")->getId() . 'description']
= $description;
+ }
+}
+}}}
== Form field naming ==
TODO