Forum LAMS for Tech-Heads - General Forum: Re: Javascript error with save from tool created by RenameTool


 
Search: 

2: Re: Javascript error with save from tool created by RenameTool
In response to 1 09/07/06 02:25 AM
[ Reply | Forward ]
Ken,

I hope you will laugh (and not cry) when you hear what the problem is.

The tool we suggested you use was "submit files". So the rename tool has replaced a whole lot of "submit"  entries with "behaviourComposer".

Including in the jsps, the tlds, and tag files. The 6 letters "submit" gets used a lot in jsp pages. e.g. onsubmit, doSubmit(), etc.

Attached is an updated set of your code that compiles deploys and the authoring and learning screens at least appear, and  you can save authoring. Its a version that has the bcSubmissionFileDAO naming stuff sorted out (I hope) and has updated jsps, tlds and tag files. If you have a decent recursive diff utility then you might want to run it over the attached code and your code to see what I changed.

There was also an update to the conf/xdoclet/web-security.xml file - replacing STAFF with MONITOR. This was a bug we fixed up just after you took your cut of the code.

What did I fix?

In web/authoring/authoring.jsp there is a function:

      function doBehaviourComposer(method) {
            document.getElementById("authoringForm").dispatch.value=method;
            document.getElementById("authoringForm").behaviourComposer();
        }

changed it to "doSubmit(method)":

        function doSubmit(method) {
            document.getElementById("authoringForm").dispatch.value=method;
            document.getElementById("authoringForm").submit();
        }

----------------------------------

In web/authoring/instructions.jsp there are references to:
    javascript:doBehaviourComposer

They were changed to
    javascript:doSubmit

----------------------------------

In web/WEB-INF/tags/AuthoringButton.tag there were bits:

    function doBehaviourComposer_Form_Only() {
        document.getElementById("${formID}").behaviourComposer();
    }

    <html:link href="javascript:doBehaviourComposer_Form_Only();" property="behaviourComposer" styleClass="button">
        <fmt:message key="${saveButtonLabelKey}" />
    </html:link>

They were changed to:

    function doSubmit_Form_Only() {
        document.getElementById("authoringForm").submit();
    }

    <html:link href="javascript:doSubmit_Form_Only();" property="submit" styleClass="button">
        <fmt:message key="${saveButtonLabelKey}" />
    </html:link>


In web\WEB-INF\struts\struts-html.tld also has a few submits that had turned into behaviourComposer and I changed them back.

If you do try to change your current copy (rather than working from the attached files), it would be best copy AuthoringButton.tag and struts-html.tld files from the original project, rather than trying to edit them.

----------------------------------

I also had to fix up similar problems in web\error.jsp, web\learner\behaviourComposerLearner.jsp, monitoring.jsp, web\mark\allmarks.jsp, web\mark\fileinfo\.jsp, web\mark\filelist.jsp, web\mark\mark.jsp\, web\mark\updatemark.jsp.

Regards,

Fiona

Posted by Fiona Malikoff

Attachments:
3: Re: Re: Javascript error with save from tool created by RenameTool
In response to 2 09/07/06 03:11 AM
[ Reply | Forward ]
Thanks -- seems to be working fine now. Now the real work begins.

I once heard a story about a novelist whose agent suggested he change a character's name from David to Brad. He did so and a reviewer wrote that he had never heard of the biblical story of Brad and Goliath.

Same lesson.

Thanks again.

Best,

-ken

Posted by Ken Kahn

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum