Ignore:
Timestamp:
Jan 20, 2010, 5:01:26 PM (13 years ago)
Author:
duh
Message:
  • refactored the wizard initial page to dynamically load pageOne, instead of rendering pageOne within the template itself. This was done because otherwise both the mainPage and pageOne had to contain duplicate logic. The ajaxified webflow works better this way.
  • added an <wizard:ajaxFlowRedirect...> tag which renders javascript code executing a jQuery ajax call (it actually wraps around <wizard:button...> tag but lifts the ajax call out of the button and wraps javascript tags around it)
  • improved the help / tooltip workings
  • extended the <wizard:button...> with an afterSuccess argument which executes some javascript after success. This is different from the default submitToRemote 'after' behaviour which is always executed in parallel with the ajax success call (hence, you javascript cannot access ajax result data while the afterSuccess method can)
Location:
trunk/grails-app/views/wizard/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/wizard/common/_navigation.gsp

    r88 r101  
    1515%>
    1616    <div class="navigation">
    17       <g:if test="${page>1}"><wizard:ajaxButton name="previous" value="&laquo; prev" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" class="prevnext" /></g:if>
     17      <g:if test="${page>1}"><wizard:ajaxButton name="previous" value="&laquo; prev" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="attachHelpTooltips()" class="prevnext" /></g:if>
    1818      <g:if test="${page>1 && page<pages.size}"> | </g:if>
    19       <g:if test="${page<pages.size}"><wizard:ajaxButton name="next" value="next &raquo;" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" class="prevnext" /></g:if>
     19      <g:if test="${page<pages.size}"><wizard:ajaxButton name="next" value="next &raquo;" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="attachHelpTooltips()" class="prevnext" /></g:if>
    2020    </div>
  • trunk/grails-app/views/wizard/common/_wizard.gsp

    r88 r101  
    11<%
    2 /**
    3  * Wizard template with first page rendered
    4  *
    5  * @author Jeroen Wesbeek
    6  * @since  20100113
    7  * @package wizard
    8  * @see    dbnp.studycapturing.WizardTagLib
    9  * @see    dbnp.studycapturing.WizardController
    10  *
    11  * Revision information:
    12  * $Rev$
    13  * $Author$
    14  * $Date$
    15  */
     2        /**
     3        * Wizard template with first page rendered
     4        *
     5         * @author Jeroen Wesbeek
     6         * @since 20100113
     7        * @package wizard
     8         * @see dbnp.studycapturing.WizardTagLib
     9         * @see dbnp.studycapturing.WizardController
     10        *
     11        * Revision information:
     12        * $Rev$
     13        * $Author$
     14        * $Date$
     15        */
    1616%>
    17   <div id="wizard" class="wizard">
    18     <h1>Proof of concept AJAXified Grails Webflow Wizard</h1>
    19     <g:form action="pages" name="_wizard" >
    20     <div id="wizardPage">
    21       <g:render template="pages/one"/>
    22     </div>
    23     <g:render template="common/error"/>
    24     </g:form>
    25   </div>
     17<div id="wizard" class="wizard">
     18        <h1>Proof of concept AJAXified Grails Webflow Wizard</h1>
     19        <g:form action="pages" name="wizardForm" id="wizardForm">
     20                <div id="wizardPage">
     21                        <wizard:ajaxFlowRedirect form="form#wizardForm" name="next" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="handleHelpTooltips()" />
     22                </div>
     23                <g:render template="common/error"/>
     24        </g:form>
     25</div>
Note: See TracChangeset for help on using the changeset viewer.