Note that there are some explanatory texts on larger screens.

plurals
  1. PODo I need hidden buttons for each transition in Spring WebFlow2 on my form
    primarykey
    data
    text
    <p>Do I need hidden buttons for each transition in Spring WebFlow2 on my form?</p> <p>I am starting to not like Spring WebFlow2 if this is true. Someone is telling me I need a hidden button for each transition I would like my form to have. Example If I have a form with a submit and reset I understand I should use two buttons.</p> <p>But if I have a form that needs to kick off a transition to load some data on the form do I really need a button for each transition type? I would found this crazy but is it true?</p> <p>He is my store. I have a form that the user starts to fill out and once the user clicks on a radio button I need to load a number of schools into a dropdown for the user to pick. The only way I found to do this is to use javascript and a hidden button to kick off the loadschool transition type. example:</p> <p></p> <p><strong>Is this the best way? Is this the only way? Do I really need a button for each transition?</strong></p> <p><strong>My Flow:</strong></p> <pre><code>&lt;view-state id="SchoolVisitReport" view="SchoolVisitReport.jsp" model="visit" &gt; &lt;transition on="submit" to="addVisit"&gt; &lt;evaluate expression="flowActions.validateVisit(visit, messageContext)"/&gt; &lt;/transition&gt; &lt;transition on="loadSchools" to="SchoolVisitReport" &gt; &lt;evaluate expression="flowActions.initializeSelectableSchool s(visit)" result="flowScope.selectableSchools"/&gt; &lt;/transition&gt; &lt;transition on="cancel" to="endState" bind="false"/&gt; &lt;/view-state&gt; </code></pre> <p><strong>My JavaScript:</strong></p> <pre><code>function loadSchools(strBorough) { alert("Loading Schools for borough " + strBorough); document.visit._eventId_loadSchools.click(); } </code></pre> <p><strong>My Radio Buttons:</strong></p> <pre><code>&lt;form:radiobutton tabIndex="9" onchange='loadSchools();' value="B" path="borough" /&gt;Bronx-X&lt;BR&gt; &lt;form:radiobutton tabIndex="10" onchange='loadSchools();' value="K" path="borough" /&gt;Kings-K&lt;BR&gt; &lt;form:radiobutton tabIndex="11" onchange='loadSchools();' value="M" path="borough" /&gt;Man.-M&lt;BR&gt; </code></pre> <p>So can someone please tell me if I am doing this the right and best way with webflow2.. thanks</p> <p>I tried the following code but the form does not get submited</p> <pre><code>&lt;script type="text/javascript"&gt; Spring.addDecoration(new Spring.AjaxEventDecoration({ elementId : "borough", formId : "visit", event : "onChange", params : { _eventId : "loadSchools", fragments : "body"} })); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload