Changeset 105


Ignore:
Timestamp:
Jan 22, 2010, 12:37:14 PM (14 years ago)
Author:
duh
Message:
  • Firefox 3.6 + firebug's XMLHttpRequest option break the wizard, submitted a bug report and added some feedback to the wizard for this particular bug
  • Some wizard changes
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy

    r103 r105  
    4848                        flow.page = 0
    4949                        flow.pages = [
    50                                 [title: 'Study'],
     50                                [title: 'Study'],               // study
    5151                                [title: 'Twoooo'],
    5252                                [title: 'Trois']
     
    5555                }
    5656
    57                 // render the main wizard page
     57                // render the main wizard page which immediately
     58                // triggers the 'next' action (hence, the main
     59                // page dynamically renders the study template
     60                // and makes the flow jump to the study logic)
    5861                mainPage {
    5962                        render(view: "/wizard/index")
     
    6467                }
    6568
     69                // render the study page and handle study logic
    6670                study {
    6771                        render(view: "_study")
     
    7276                        on("next") {
    7377                                // create a study instance
    74                                 println params
    7578                                flow.study = new Study(params)
    7679
    7780                                // validate study
    7881                                if (flow.study.validate()) {
    79                                         println "study validates"
     82                                        success()
    8083                                } else {
    8184                                        // validation failed, feedback errors
    8285                                        flash.errors = new LinkedHashMap()
    8386                                        this.appendErrors(flow.study,flash.errors)
    84                                         println "errorrrs"
    85                                         println flash.errors
    8687                                        error()
    8788                                }
     
    154155                }
    155156        }
    156 
    157157}
  • trunk/grails-app/views/wizard/common/_error.gsp

    r103 r105  
    2525        </div>
    2626        <script type="text/javascript">
     27                // show error dialog
    2728                $(function() {
    2829                        $("div#wizardError").dialog({
  • trunk/grails-app/views/wizard/common/_wizard.gsp

    r103 r105  
    2121                        <wizard:ajaxFlowRedirect form="form#wizardForm" name="next" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="attachHelpTooltips()" />
    2222                </div>
    23                 <!--g:render template="common/error"//-->
    2423        </g:form>
    2524</div>
  • trunk/grails-app/views/wizard/pages/_study.gsp

    r103 r105  
    1616%>
    1717<wizard:pageContent>
    18         <wizard:textFieldElement name="studyTitle" description="Title">
     18        <wizard:textFieldElement name="studyTitle" description="Title" error="title" value="${study?.title}">
    1919                The title of the study you are creating
    2020        </wizard:textFieldElement>
    21         <wizard:textFieldElement name="studyCode" description="Code">
     21        <wizard:textFieldElement name="studyCode" description="Code" error="code">
    2222                A code to reference your study by
    2323        </wizard:textFieldElement>
    24         <wizard:textFieldElement name="studyResearchQuestion" description="Research Question">
     24        <wizard:textFieldElement name="studyResearchQuestion" description="Research Question" error="researchQuestion">
    2525                The research question
    2626        </wizard:textFieldElement>
    27         <wizard:textFieldElement name="studyDescription" description="Description" />
    28         <wizard:textFieldElement name="studyEcCode" description="Ethical Committee Code" />
     27        <wizard:textFieldElement name="studyDescription" description="Description" error="description" />
     28        <wizard:textFieldElement name="studyEcCode" description="Ethical Committee Code" error="ecCode" />
    2929</wizard:pageContent>
  • trunk/web-app/js/wizard.js

    r101 r105  
    1414 */
    1515$(document).ready(function() {
     16    re = /Firefox\/3\.6/gi;
     17    if (navigator.userAgent.match(re)) {
     18        // http://code.google.com/p/fbug/issues/detail?id=1899
     19        var wizard = $('div#wizard')
     20        wizard.html('<span style="color:red;font-size:8px;">You are using firefox 3.6, note that firefox 3.6 in combination with firebug (latest 1.6X.0a3) and XMLHttpRequest enabled in the console, break the workings of this wizard... Either disable console XMLHttpRequests, disable firebug altogether or downgrade to Firefox 3.5.7 instead</span>' + wizard.html())
     21    }
     22
     23    // attach Tooltips
    1624    attachHelpTooltips();
    1725});
    1826
     27// attach help tooltips
    1928function attachHelpTooltips() {
    2029    // attach help action on all wizard help icons
Note: See TracChangeset for help on using the changeset viewer.