The wizard must only go through one action, e.g. actionWizard($step). Step and wizard completion processing is done in event handlers.
If you want to pass additional parameters you can do something like:
public function actionWizard($step=null, $p1=null, $p2=null) {
if (is_null($step)) { // only at the wizard start
$session = Yii::app()->getSession();
foreach(array(p1,p2) as $p) {
if (!is_null($$p)) {
$session[$p] = $$p; // save the parameter to the session
}
}
}
$this->processStep($step);
}
Then your event handlers can use the parameters saved in the session as required.
In the processStep handler check to see if a colour has been given; if not allocate one. You can get the data for previous steps via the read($step) method; supply a step name to get data for that step only or leave empty to get data for all steps.
Put the handling of the two steps in the processStep event handler, and anything that should happen at the end in the finished event handler or in the controller/action pointed to by finishedUrl.
How to skip one step from wizard? I do not have any branches, I need only to skip one step if some conditions happen. I need also everythink wokring when previous button is pressed (also skip given step if it was skipped before).
Hi, I’m having an issue with the Plot Branching, I’m finding that my steps within the branch are getting lost. I believe they’re being overwritten by the steps after the branch. My steps are:
I’m using BRANCH_SELECT and BRANCH_DESELECT to enable or disable the customer search branch based on which path the user came into the wizard. However the resulting steps when enabled are:
[list=1]
[*]staffForm
[*]customerSearchForm
[*]customerForm
[*]documentationForm
[*]confirmationForm
[/list]
The customerSearchResultForm is missing. When doing some digging I found that _parseSteps did:
$parsed[$label] = $step;
Where $label is the index of the step, this means though that as the steps are built the following happens:
first of all I would like to give you thanks for such a nice extension.
Today,i was playing with extension and i got some question in my mind.On which i am still working.SO, it would be great if you can also dig into this problem and can share your thoughts for this.
Here is my problem :-
"I am Creating a multi step form to Add a Product with the help of this extension.But i have some questions in my mind.
What about a Image Upload in the Step forms. How to use a File type input element in the form.How to deal with it.
How to use a Fckeditior Widget with Text Area input element.
And last One to get a better Idea from you.
How to save a data After complete a form steps.
"
Kindly please help me here.i am waiting for your kind response.
Sorry, but I don’t follow what you are saying here. Could you please give an example using registrationWizard on how to save each step to the database? Also, I want to have the user login to retrieve their profile rather than persist in the session. What do you recommend? Thanks!
Is there any solution for using this extension with active records? I have active records because of working with data from a database. Now I want to create new data by using such a wizard behavior. I want to combine a few forms and on submit the entries in the database will be created.
Problem is the "getForm()" function of the model, because my model is an active record.