I have a pipeline which I would like to work like this
Section A
- User navigates to form A. Selects some pictures for upload
- Form is submitted, images are uploaded, processed with Java in the backend and returned to user in summary page A
- User selects which photos to further process then clicks “Further process selected”
Section B
- Selected photos from A.3 are processed and displayed along with form B
- User selects some more options and submits
- Photos are displayed in form B’s summary page (summary page B)
I have section A implemented. The paths to the images are stored in form A’s model. In summary A, when the user checks a photo, a javascript array variable is updated with the selected images’ paths
What I am having trouble with passing this javascript variable to form B
Is this possible? is there an alternative? Please let me know if I haven’t explained my self well
Thanks
Supplying the javascript variable to Form B is straightforward — you just add it as a global Javascript variable in the generated page. So your template would have:
You could either recompute
theJavaScriptVariablein your controller before passing it to the template, or you may be able to submit it along with the rest of Form A as a hidden field, and cache it with the user’s session. You would need to serialise it (e.g. with the jquery JSON library), and probably deal with escaping.