0
votes

I am using the toolbar from the extension library in a workflow application. I need a "Cancel" button that will allow the document to close w/o validation. Much of the data is being entered into the database via a web service but the remote application cannot populate all of the required fields. If a user edits a document and changes their mind, they need to be able to cancel instead of having to close the browser. I have tried things like window.location.href="abc.123.com" context.redirectToPage(view);
history.back(); Adding a second event handler

Any Ideas?

1
What happens when you used context.redirectToPage? Did you specify whether to disable validation?Steve Zavocki
If my answer below fixes your problem then please accept the answer by clicking on the green check box on the left. ThxSteve Zavocki
The problem is the toolbar has many actions possible. In my app, I have Save, Save & Exit, Cancel, etc. For all but Cancel I need the validation to run so i can't disable it as part of the event. That is why I tried 2 event handlers. Also, contect.redirectToPage causes the validation to run.Steve G
I think that I understand your problem better. The serverside onItemClick() isn't going to work for you. Assuming you have a basicLeafNode called "Cancel". You will need to use clientside code in the onClick event of the node. Going to move this to my answer, so I can paste proper code.Steve Zavocki
Updated my answer. Hope this helps!Steve Zavocki

1 Answers

1
votes

Now that I have a better understanding of your question, please try the following.

  • In your toolbar, create a basicLeafNode inside the toolbar and call it "Cancel", which you likely already have
  • Put the client side code in the onClick event that is similar to below.
  • Do not do what I suggest in my original answer by disabling validation

    <xe:toolbar id="toolbar1" xp:key="MastHeader">
        <xe:this.treeNodes>
            <xe:basicLeafNode label="Cancel">
                <xe:this.onClick><![CDATA[location.href="/dbpath/yourdb.nsf?logout&redirectTo=/dbpath/yourdb.nsf";]]></xe:this.onClick>
            </xe:basicLeafNode>
        </xe:this.treeNodes></xe:toolbar>
    

If this is what you already tried, please verify your code. This should not trigger any serverside validation. If you are using clientside validation, your results may vary.



Please check the box to "Process data without validation" in your event. Check this box, and the validation step will be skipped. Of the things you tried, I would use context.redirectToPage(view) with this option. This is a server-side event. This assumes you are not using clientside javascript to perform validation which is what it sounds like you are doing. Unlike the screenshot, you will want to perform a full update.

enter image description here