Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set object to FlowScope in Action View Method #6

Open
pablocossioabastoflor opened this issue Sep 12, 2015 · 3 comments
Open

Set object to FlowScope in Action View Method #6

pablocossioabastoflor opened this issue Sep 12, 2015 · 3 comments

Comments

@pablocossioabastoflor
Copy link

Hi, thank you again for share your work.

I built a flow to save hotel bookings before, and now I want to use the same in Edit mode.
I have an action named "start" that is not a flow step. This action "start" shows the View for first step.
I set all Flow Scope objects in "start" method in edition mode, to be able to preview the data.
The problem is, as the "start" method is a view method, when I set the flow scope objects, it get lost on the next step. I know I can put these data as hidden fields, or save to the session. But I was hoping to avoid that to make the code as clean as possible, and use the plugin Flow Scope.

Then I think, it would be great to pre populate all the Flow Scope Objects, just before the flow starts.

Here is the source code.

public String start() {

    if (editMode && bookingID > 0) {
        setBookingProfile(bookingManager.getBookingProfile(bookingID));
        setGuestProfile(bookingProfile.getGuestProfile());
    }
    return SUCCESS;
}

     <action name="start" method="start" class="com.pms.web.actions.GuestReservationFlowAction">
        <result type="tiles">guestReservationFlowStep1</result>
    </action>

    <action name="step1" method="step1" class="com.pms.web.actions.GuestReservationFlowAction">
        <param name="actionFlowStep">1</param>

        <result name="input" type="tiles">guestReservationFlowStep1</result>
        <result name="error" type="tiles">guestReservationFlowStep1</result>
    </action>

    <action name="step2" method="step2" class="com.pms.web.actions.GuestReservationFlowAction">
        <param name="actionFlowStep">2</param>

        <result name="input" type="tiles">guestReservationFlowStep2</result>
        <result name="error" type="tiles">guestReservationFlowStep2</result>
    </action>

    <action name="step3" method="step3" class="com.pms.web.actions.GuestReservationFlowAction">
        <param name="actionFlowStep">3</param>

        <result name="input" type="tiles">guestReservationFlowStep3</result>
        <result name="error" type="tiles">guestReservationFlowStep3</result>
    </action>

Thank you in advance.

@aleksandr-m
Copy link
Owner

Which action do you execute when values are getting lost? Which version of the plugin do you use? Can you show your start jsp?

@pablocossioabastoflor
Copy link
Author

The action attributes marked with "@ActionFlowScope" are saved to the scope on submit forms right?. I was hoping to be able to set these "@ActionFlowScope" attributes to the scope at any time manually, for example from some overwriten "View Method" like "step3View" having a step action named "step3".

@aleksandr-m
Copy link
Owner

What do you mean by at any time manually? Can you show some code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants