Creating a workflow in a single form in Struts2 - struts2

I'm using struts2-jquery-plugin-3.7.0. I'm looking for a component that can create a workflow by exhibiting (creating) multiple steps in a single form on a page in which the current step is processed partially and display the next step if and only if the current step passes validations.
All the steps must be performed sequentially in a defined order.
For example, in a user registration form, personnel information of a user must be filled up first before filling up her contact information and so on.
If any validation is violated while filling up personnel information then, the next step (to fill up contact information) must not be executed. It should only be executed, if no validation is violated in personnel information.
Currently, I can only see <sj:tabbedpanel> which doesn't seem to fulfill these requirements.
Is there any component that can be used in Struts2 to fulfill these requirements?
Long story short : I'm looking for exactly the same component as provided by PrimeFaces <p:wizard> Anyway, I need to create a workflow in which a single page of activities can be exhibited in different and sequential steps. Is there a handy way that can make it possible?

So you want a plugin-in or component for multi-step form in struts2. Well there is no such implementations now, but you can create one of your own. There are many so examples in google.
This one implementation I found in struts2.
Even this is not a bad option. You need to program the underlying logic :)
CSS3-Jquery

Related

Intermediate save and readonly after termination

We have the requirement that users, after terminating the input of a form, can only see the data; only authorized users can modify the data.
For this purpose we use the following permissions and it works smoothly:
Now raised a second requirement.
The users wish the possibility to finish the input of the form in a second moment, so that they don't have to fill in the form entirely after pressing the new button, before they can push the save button.
Because some forms are large and maybe they are in a hurry to catch the bus, or maybe for some answer they have to ask someone else not contactable at the moment.
The idea was to add the save-draft button.
The first save-draft is OK; the message is "Draft saved successfully!".
But the second save complains:
It seems that the permissions don't differentiate between save and draft-save, so that also after a draft-save the form data is read-only.
Which possibilities I have to achive this two goals?
Many thanks.
The save-draft process is very much like the regular save (save-final process), except that it lets users save data even if the value of some fields is invalid. So, indeed, from the perspective of the permissions, save-final and save-draft are the same.
What you would really need is the ability for:
A process to save the stage of the form along with the data. In your case, the stage could be "work in progress" or "submitted".
The permissions to be able to depend on that stage, so you can say "users can edit their own data if the stage is work in progress, but can only view it if the stage is submitted".
You can do #1 right now using a hidden field and an xf:setvalue() action. But you can't do #2. For that, you would need the workflow feature to be implemented (see RFE #2256), which we hope to be able to complete in 2018. So, you guessed it, the good news is that this is coming, but the bad news is, at least as I write these lines, that it isn't implemented yet.

Umbraco Contour Multi step forms - deciding next step based on user input

I am using UmbracoCMS and Contour_1.1.12
While creating multi step forms, i need to dynamically decide, which form will be visible in the next step, based on certain field values the user has provided in the previous step.
For example in contour multi-step forms, there is a step in which user has to provide input using a checkbox field. After filling the form in this step the user will click the Next button to move to the next step. Now i want to either display or skip the next step based on whether the user selected the checkbox or not.
Many thanks.
I think you might be able to do this by hooking into the Contour event model/Workflows. The Contour developer docs have some useful info on creating workflows and can be downloaded from here.
I've had some difficulties hooking into the workflow model - I'm not sure that its entirely bug free! I would use javascript/jquery to hide or display the next field as an interim measure.
page load (http://api.jquery.com/ready/) -> show dropdown / hide optional question
dropdown changes (http://api.jquery.com/change/) -> decide whether to show/hide optional question
Sorry for the late reply but you can always use USERCONTROLS to do this type of work.. Create User Control in different project, test them based on your flow and then use it in umbraco by creating macros.
see this link for the same that explain how to use it.

multi-step registration

I am currently using sfDoctrineGuardPlugin and sfDoctrineForkedApplyPlugin for my user management.
This works well for me and users can register/login etc
The problem comes with the registration part. The Profile relation that I have is getting particularly large in terms of fields users are required to fill out on registration.
I was thinking of possibly creating a multistep process, possibly 2 steps.
Step 1 is the main details, such as name, username, password etc
Step 2 is the address and my other fields
I don't want my users to scroll down to fill out 25 fields on a single form
I'm not entirely sure how I'd do this and I cannot find any information regarding carrying out this.
Has anyone ever done this before and If so, could someone point me in the right direction of how I'd do this?
Thanks
I'd create a form class for every step. When processing the submitted form, save the submitted part to the session if validation passes.
In the end you'll have an array of validated values for every step, just compose your model object out of them, and save the object.
Here is a generic way of handling multi-step forms in Symfony:
How to 'validate' a Symfony form in steps - instead of calling $form->isValid()

ASP MVC Creating Form Rows Dynamically

I haven't even attempted this yet and am creating this question for advice really.
I have a strongly typed page which receives a form model composed of several components. It is to create a mitigating circumstance (MC) for a student at a university for my final year project. A MC can be composed of the initial problem, assessment extensions, and I use a multi select box to allow the user to select staff retrieved from the database which are able to view the MC once created.
The thing is I feel that a student could be granted many assignment extensions for one problem. I am wander if it is possible to include a button/image on the form which when clicked will create a new assessment extension object, and duplicate the form components to set the values for the object? This would all need to occur without any page refreshes.
Any advice, or links to good tutorials would be appreciated. I have so far been unable to find any suitable examples.
Thanks,
Jon
There are a number of ways to do this, but the fastest is to create a javascript handler which creates the form controls without any sort of server request, all you need to do is keep track of how many items are in your list so you can name the form controls correctly.
Start by making a button that when you click on it creates form controls. Once you get that, work on the naming.

how to create wizard forms in ruby on rails

I'm trying to understand the best options for pulling off a wizard form in ruby on rails. Ideally I'd like to have it so the application signup has a back and next button that allows the user to submit data in steps.
So in step 1 they could fill out contact info. Once they are done they could click next and be on step 2 to fill out payment info, etc. If they make a mistake, they can click back and correct it. Some steps will be required, while others will not, but you do have to make it to the last step to submit the data to the database to sign up. They then need the ability to go back and fill out the past steps in the same fashion after completion. (example: perhaps if they clicked on a profile link they could recomplete the steps in the same fashion because they didn't want to complete all the steps right away. Maybe by being given a skip button before they completed the steps to sign up?). I also need validation to happen on what steps have been completed preventing them from moving onto the next step until corrected or completed.
Option 1) I've noticed that ajax has been recommended as an option in other questions on stackoverflow. The only problem I have with it is that the user would not be able to sign up if javascript was disabled. Ideally I'd like to have it be native to ruby on rails but I'm willing to work with whatever is necessary to get it to work.
You should watch this rails cast episode on multi step forms:
http://railscasts.com/episodes/217-multistep-forms
Be prepared to rewind and watch again. He's very quick!
There are a couple of plugins that provide wizzard construction facilitation in rails.
Acts as Wizard and Wizardly seem the most popular.
The main idea is to:
* create a model in the first step
* then edit it on subsequent steps,
* applying partial validation on each step and
* having the model implement some sort of state machine.
Wicked looks promising for rails 3:
https://github.com/schneems/wicked
Have a look at wicked, explained in this rails cast: http://railscasts.com/episodes/346-wizard-forms-with-wicked?autoplay=true
An alternative approach, for simpler multi step forms especially, is to simply show-hide parts of a single form depending on the step, this way you don't hit the database on every step but rather let the user build up his object until he's ready with a valid instance.
Such an approach strongly favors using a form class instead of working with the model directly (http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/) and you need to tweak error message rendering a bit.
Pros: only one db hit, no hassle with persisting invalid instances (not null columns, before_save sanity checks for messed up attributes), no callback hell
Cons: more html sent to user, error message tweaks, requires a well built form class to be elegant and really useful

Resources