Hallo,
I heavily usethe modalframe to make the workflow easy as possible. I ran into several issues with the ctools multistep form.In my case a 3 step form.
At first I use automodal to make my live easier.In the most cases it do his job perfectly.
So I open the multistep form with the add_modal function. Important is here that we have to use it in this way.
automodal_add('.YOUR CC CLASS SELECTOR HERE', array('width' => 450,
'height' => 300,
'automodal' => TRUE,
'automodalClose' => FALSE
)
);
Important is here the automodal close part, it will not work without the false after the first submitting it stops.
Okay, now I see the second problem. The next form will use the standart template instead of the modalframe template. I change this in the following way. I just add the modalframe_child_js() function to the MYMODULE_wizard()
function MYMODULE_wizard() {
// Modalframe
modalframe_child_js();
// required includes for wizard
ctools_include('wizard');
ctools_include('object-cache');
$step = arg(3);
if($step == ''){$step = 'create';}
Disadvantage here is obviously. This form will always rendered with modalframe template. In my way I don't care,because my users will always use the modalframe and the users have javascript enabled. I'm open for suggestions here.
My main problem is now that I'm not able to close the modalframe after clicking the submit or finish button of the last form. In the last form is no more validation needed and should just close the modal and redirect. I try now everything: starting with add the modalframe_close_dialog() in the last submit function, writing an own submit function witch calls the modalframe_close_dialog function. But nothing works. I just see that the redirect of the ctools form is working.(I also try to disable it and setting it to false) Nothing!
Is this a bug or incompatibility of modalframe and ctools or I am just to blind to see the "right" way?
Comments
Comment #1
broncomania CreditAttribution: broncomania commentedI started this topic also in the ctools forum with minor luck. Merlinofchaos give his best thx but he is not involved in the development status of modalframe.
I am still not able to close this modalframe. I tried everything begining with preprocess functions, submit functions, ctools finish function, Javascript modalframe close function, redirect to another url to close this crazy modalframe,....
Now, I think that I am the only one who tries to combine ctools multistep forms with modalframe. I am really wondering because these are best modules for both purposes. I see the willing of help from merlinofchaos but I think I need some support from the developer of the modalframe. Any help is appreciated.
Thx Bonco
Comment #2
dsnopekIf you're using CTools to make a multi-step form, you really should use the CTools modal dialog API! There is "help/modal.html" file in the CTools module that explains how to use it.