Domino Blog dot com - Free Blog Toolkit for Domino

 web design framework for Lotus Domino  
 
Navigation
 
Site:
 ›home
 ›about
 ›news
 ›the author
 ›hire the author
 ›donate to site
 ›live! project cam
 ›projects
 
Issue Archive:
 ›may 2003
 ›april 2003
 ›march 2003
 ›february 2003
 ›january 2003
 ›december 2002
 ›november 2002
 ›october 2002
 
Technical:
 ›articles
 ›downloads
 ›links
 
DXFramework:
 ›about
 ›articles
 ›screenshots
 ›demos
 ›licencing
 ›take part
 ›documentation
 

I have been asked the question a few times - so heres the deal.

 

I like using them! - some people might start coughing now - but the reasons why are:

  • No browser buttons that the user can misuse (they created some data and now they press the back button ring support and say the dumb application isn't working again!)
  • Always on top
  • The user cannot click away until you decide they can

With websites the above isn't needed - but i dont create websites (I would be unemployed - look at this one!) I create applications - but everyone wants them to work in a browser. Unfortunately a browser is as dumb as referees in sports matches (for me its football) - and just as blind to what is going on around them.

 

So for me the modal dialog capabilities of IE help to protect the application (and the user) from the browsers issues.

 

ok - a bit of code - to create a modal window you use:

 

var data=window.showModalDialog(url of your document,data to pass to document,"scroll:no; dialogWidth:300px; dialogHeight:300px; center:yes")

 

To send data to the document you would do:

 

var dataarray as new Array()

dataarray[0]="fred"

dataarray[1]="bloggs"

 

This code would come before the above bit and you would insert your dataarray in the second parameter.

 

Once your window has launched with your notes page,document - whatever - You would then be able to retrieve and use the parameters using:

 

var incomingdata=window.dialogArguments

 

Therefore in this example incomingdata[0] would equal fred incomingdata[1] would equal bloggs and so on.

 

ok - now perhaps you would have some fields on your document - maybe a bit of javascript jigery pokery and now you want to close the window and return the data.

 

So provide the user with a close button and the following code will do the trick:

 

function soCloseMe(){

window.returnValue=outgoingdata (an array constructed with the data you wish to pass back - or could be a string)
window.close()

}

 

Now we come a full circle and we are back to your original call:

 

var data=window.showModalDialog(url of your document,data to pass to document,"scroll:no; dialogWidth:300px; dialogHeight:300px; center:yes")

 

data now equals your outgoing data and you can continue on your way.

 

Questions? - steve.castledine@projectdx.org

 
 
copyright 2002-2003 - Steve Castledine - ProjectDX.org