Could someone please help with an XPages/Dojo dev issue?

I am having a development issue that I am hoping someone has run into before (and presumably resolved!).

I have an XPage that displays a document, and I want to allow users to add comments to the document.

I have successfully incorporated the “comment” feature used in the “XPages Wiki” project on OpenNTF (OpenNTF.org - The Open Source Community for Collaboration Solutions).

I can add comments, and they are created as separate response documents and displayed perfectly.

The issue arose when I ventured into unfamiliar territory (that’s a pretty big space!), and tried to enhance the feature so that the addition of a comment appeared as a dialog box instead. In the Wiki project, a space for comment posting is always visible - I wanted to have users click a link to expose a dialog box where they could post their comments.

I used Dec’s “Advanced XPages : A Nicer Domino Login” tutorial (Advanced XPages : A Nicer Domino Login Part 1 | Dec's Dom Blog) to learn how to display and use a dialog box to offer login facilities - worked beautifully.

OK, so the problem came when trying to apply what I had learned about Dojo from Dec to my original development…

I have a custom control that contains a couple of fields: author & comment.

All of the necessary Dojo resources are loaded in the custom control, and the entire contents is surrounded by a DIV with a dojoType of “dijit.Dialog”.

I placed a link on my XPage that successfully displays the new dialog box, and accepts comment data.

However… No matter what I do, the comments are never saved and response documents are not created.

I have placed two buttons in the custom control to try and determine the source of my issue.

The first button contains all of the original server-side script that works fine if the feature resides outside the dialog box. This button never seems to fire at all.

The second button simply issues an alert and hides the dialog box - That works fine.

I found that if I change the “server options” of the second button to anything other than “no submission”, it won’t work either.

So, I believe that my issue relates to the use of server-side script or data submission within a Dojo dialog box.

That’s my best guess, but I wanted to throw this out there before I spent hours trying to fiddle with something that may not be supported.

Am I attempting something that is not possible?

Can someone point me in the right direction?

I have started trying to locate resources (with examples) to learn more about Dojo (I’m more familiar with jQuery), so any links that y’all may be able to provide would be most appreciated as well.

Cheers!

T.

Subject: Re: Submitting dialog

Ther are problems passing values back from a dijit dialog, but they can be overcome. I’m not sure if this will help, this ia an audit comments dialog I’ve created which saves comments back into a field on the current document - the dialog is created on load. However, by looing at it you might be able to see what needs changing. There are also links to a couple of other articles on the same topic. http://hermes.intec.co.uk/Intec/Blog.nsf/dx/16122009200447HERRK2.htm

Subject: Thanks Paul - I am trying…

Thanks (again!) Paul.

I have downloaded your solution, and am trying to get my head around it - I believe I understand how everything is achieved.

As far as I can tell, I should be able to set a viewScope variable in the dialog box, and then use that variable in the creation of a response document (same code as was originally posted in the Wiki app) once the dialog has been hidden.

I have been able to display the dialog, and I believe that the viewScope variable is being set properly.

I’m up to trying to trigger a server-side script function to use that variable and create the new response document.

I believe (in theory) that it should be possible, but I’ve been at it for quite a few hours now (yup, still heading UP the learning curve!). I’ve also checked out your articles on triggering server-side script with client-side script, but I’m running into all sorts of issues with that.

I’ll keep plugging away, and really appreciate your attention to my pleas for assistance.

Hopefully, I’ll be able to offer the same sort of help to others once I’m more competent.

Cheers!

T.