Dialogbox in Browser

I am currently web-enabling a Database that previously only works in Notes Client. I have a button in my form that opens another form using @dialogbox formula. The problem is I don’t know how to write a javascript to produce the same result ?. Any help is very much welcomed.

Thanks & cheers.

Subject: Dialogbox in Browser

try this Javascript code :

var path=location.pathname

var loc=path.indexOf(“.nsf”)

var filename=path.substring(0,loc)+“.nsf”

urlKey = filename + ‘/frmMessage?OpenForm’

windowOptions = ‘width=400, height= 240, left=200, top=150, status=no, toolbar=no, menubar=no,scrollbars=no’

open(urlKey, ‘’, windowOptions)

replace “frmMessage” with your form name.

you could also tweak the windowOptions for width,height, etc …

cheers!!

Subject: RE: Dialogbox in Browser

The reason why ask the question was because I had this little problem writing a browser compatible code. The problem is how do i do all the ‘looping’ code in Javascript, or can I put my existing code as agent and call it. But then again I can only call it through Client but not browser. Can anybody there give a some advice.

Cheers.

Here’s what i want to implement.

I have a Helpdesk application whereby the request is logged in the request form. Staff assigned to do the job log their action in a form called Action Taken Log (ATL). The request and action taken documents are tied by a unique Doc. I.D. If a staff has created an ATL, then open the existing one, otherwise create a new one.

(A button in the request form)


Sub Click(Source As Button)

Dim session As New NotesSession

Dim db As NotesDatabase

Dim ws As New notesuiworkspace

Dim finddoc As notesdocument

Dim view As notesview

Dim user As String

user = session.CommonUserName



uidoc.EditMode = True

Set db = session.CurrentDatabase		

'Go to 'Problem Logging Action Taken Lookup' view; Has the doc. been created ?  

Set view = db.GetView( "PLATLookup" )

key$ = uidoc.fieldgettext("DocID") & "~" + user

Set finddoc = view.GetDocumentByKey(key$)



'If no ATL document is found then, create a new one

If finddoc Is Nothing Then

	Call uidoc.FieldSetText("CreatedATL","Yes")

	Call uidoc.save	

	Call ws.ComposeDocument( "", "", "ATL" )

Else

'if a document is found then open it. (i.e open finddoc)

	Call ws.DialogBox("ATL", True, True, True, False, False, False, "Action Taken Log", finddoc, False, True)

	'Call ws.DialogBox( form$ [, autoHorzFit [, autoVertFit  [, noCancel  [, noNewFields [, noFieldUpdate [, readOnly [, title$ [, notesDocument [, sizeToTable [, noOkCancel  ]]]]]]]]]] )

	

	

End If

End Sub


Subject: Dialogbox in Browser

you can use either the window.open or the window.showModalDialog method.

Difference betweene these two, is that window.open will show the ‘DialogBox’ and continue what`s next on the script; while window.showModalDialog will show the ‘DialogBox’ and wiat until you close it before continue with the script.

Sergio R.

Subject: RE: Dialogbox in Browser

Thanks a million guys. It works fine now. I haven’t tested the window.open AND window.showModalDialog though. Thanks again.

Subject: RE: Dialogbox in Browser

Bear in mind that ShowModalDialog works in IE only, and it provides no way for the child window to communicate with its parent (e.g. you cannot use window.opener) Further, it creates a window that is modal to ALL open browser windows, not just its parent.

There are programmatic ways to make window.open(…) behave modally.

Subject: RE: Dialogbox in Browser

You can’t use window.opener, no, but there’s window.dialogArguments (of which the opener usually is one, using “this” in the showModalDialog() params). That’s not to say that I approve of showModalDialog() (unless it becomes a standard some day), just that you can get to the parent easily enough.