I have several “Save” or “Save & close” buttons in web forms in applications I maintain with following properties:
The formula code of the button that runs in “onClick” event is:
@SetField(“publish”;“1”);
@Command([FileSave]);
@Command([FileCloseWindow])
In the button properties, last tab “HTML” I have in the “other” field following JS code:
onMousedown=“createListOfPortalCells()” onMouseup=“this.disabled=true” title=“The portal page will be published and the draft will be marked for deletion”
The code in “other” is executed but the formula code for the click that sets the field, saves and closes the document is not executed in IE7 but works perfectly in IE6.
The Domino server is 6.5.3FP1.
However if I remove the onMouseup JS code the document is saved as expected in both IE6 and IE7.
Are there several chages in the event handling of IE7 ? Or the Java Script code supported by it at all ?
Do you cave any idea how I could conserve the functionality that works in IE6 to work also in IE7 ?
Subject: Is the onMouseup event blocking everything after it in a Web button in IE7 ?
Interesting. Sounds like a good warning to us to test well with IE7.
IF the onMouseDown event is firing before the onClick event, that would be the problem. If that is the issue, how about putting the @Functions into the onMouseDown? Well, you can’t put it in directly, but you certainly could edit your function createListOfPortalCells() to set a field and do .Submit().
Subject: RE: Is the onMouseup event blocking everything after it in a Web button in IE7 ?
Hi, Doug,
thank you for your suggestion but not the “onMousedown” event causes the problem. That works perfectly in both IE versions if put in the button properties, tab “HTML”, field “Other”.
The “onMouseup” event is the black sheep in IE7: it doesn’t allow any other formula saving instruction after it to be executed. At least not in the context I described.
And there is also another problem: if you want to save the document with formula instructions you have no distinct events for the button to put your code there in. You must put them where I mentioned that they are.
But anyway, thank you very much for taking the time to read my posting and think a little bit about it.
Subject: RE: Is the onMouseup event blocking everything after it in a Web button in IE7 ?
Hi again, Doug,
your suggestion brought me to start a trial with buttons withouth @Formula instructions but with JScript code only put in some events.
So I managed to conserve the previous functionality and tell the button to do exactly the same as before with following trick that is quite similar to the one you suggested.
Clean the code in the formula instruction field and enable instead the JavaScript code to be executed in Client and Web. With this every event is available for inserting code.
Clean everything in the “onClick” event.
Put following code in the “onMouseDown” event:
createListOfPortalCells();
Put following code in the “onMouseup” event:
this.disabled=true;
this.title=“The portal page will be published and the draft will be marked for deletion”;
document.forms[0].publish.value = “1”;
document.forms[0].submit();
Remove everything in the field “Other” in the HTML-tab of the button properties (to not interfere or do some unexpected crap in collision with the same code put in button events available this time in the Domino Designer Objects pane in the bottom-left corner).
Take the stand alone hidden field “publish” and put it as computed field in a visible line of HTML code like this to be accessible by JavaScript:
The button does the same as before the only one difference is that nothing is executed anymore in the “onClick” event but almost everything in the “onMouseup” event.
It’s absolutely not good to have to change the available design like that just to bring them to work in IE7 but it’s good to have a solution now.