Tuesday, November 10, 2009

Xpages: Loading…. (images and masking)

Sometimes for various reasons, clicking on links in in X-page, or refreshing a view or a page may take several seconds to complete. So that users do not keep clicking on the button, or think the browser is not working, i have added a “loading image” and a mask to show people that the page is working, just a little slow.

I hope someone shows me a better way to do this… but here is my attempt.

1. In the css file for the page add

div.loading {
background-image: url(ajax-loader.gif);
background-repeat: no-repeat;
background-position: center;
background-color:black;
}




2. Add a JavaScript library and name it loading, then add these lines

dojo.require('dijit.Dialog')

function loading() {
underlay = new dijit.DialogUnderlay({'class': 'loading'});
underlay.show();
}
function stoploading(){
underlay.hide()
}



3. Insert the JavaScript library loading on the page under the resources section

Now to implement this in a button that does not do a “full update”

1. In the outline on the button expand the button and click on event handler, then clcik the all properties tab.

image

2. in the onStart event enter loading()

3. in the onComplete enter stoploading()

Now to implement this in a button that does a “full update”

1. In the onClick event, choose the client tab, then enter in loading()

image


Now to implement this in view column link

1. First we have to change how it open a document, click on the onClick event.

2. Create an action on the server side to execute a script.

3. set the script to:

doc = viewEntry.getDocument();
applicationScope.docid1 = doc.getUniversalID();



4. Create another action to open a new page, put in the page name to open, then edit document, then document id should be computed to

applicationScope.docid1




image

5. On the Client tab, enter in loading()

All of these will produce a mask covering the whole screen with a loading image in the middle like

image

image

Friday, November 6, 2009

Xpages: Web Dashboards made easy, I Love X-pages!!

On a recent project, a simple one at that, an executive wanted an overview dashboard to show totals from many different views on one page. I started thinking about how i would do this in the

Notes client...

I could make a form with computed fields and create an agent or query open LS code to get the values and set the fields values.

I could create computed fields and do it with formula language but what a pain that would be.

The old way on the web

I would to use a webquery open agent and set the values, or compute formula on the fields.

Xpages...

Well in X-pages i am allowed to create a computed field and use SSJS to compute the value. It is like having a computed field on a client based notes form and setting the value to LS, which of course you cant do.

i wrote three lines of code per field

db = session.getCurrentDatabase()
view1 = db.getView('On Site')
view1.getEntryCount()

or it could be like

db = session.getCurrentDatabase()
view1 = db.getView('On Site')
dc1 = view1.getAllDocumentsByKey('test')
dc1.getCount()


and of course you can do a

db = session.getCurrentDatabase()
view1 = db.getView('On Site')
dc1= view1.getAllDocumentsByKey('test')
doc = dc1.getFirstDocument()
total = 0
while(doc != null)
{
total = doc.getItemValueDouble('amount') + total
set doc = dc1.getNextDocument(doc)
}

total.valueOf()

X-pages made this easy web development, compared to what i had to do in the past

Wednesday, November 4, 2009

Questions?: Want to use Safari as default browser for enterprise

It has been noticed by management lately that IE is a horrible browser, i have known this for a long time. It is big, it is slow, and it does not support many web standards. Since we might start standardizing on the iPhone as the business phone over the blackberry, the thought occurred to use Safari 4 as the default browser in our company, otherwise maybe FF35 would be just as good or better.

A couple of questions that maybe only the enterprise would care about.

1. Can you set the update software to poll an internal server for the Safari Updates? So every client does not go to the internet to get the new downloads.

2. Can you set policies to control custom settings or setup options?

3. Does Lotus support Safari for inotes?

Thanks for any help anyone can provide

Update: It appears there is an Apple Software Update Server that can be run on a mac mini that will update even the windows machines apple software.

Wednesday, October 28, 2009

@URLEncode and X-pages

I had a circumstance where i needed to encode a variable with spaces into a web link via ssjs. So i looked for @URLEncode(), it not there.... So I emailed Paul Hannan and asked if there was a way to do this, and as usual he came back with a quick response with an answer.

Here is the code i used in SSJS

attachmentnames = java.net.URLEncoder.encode(@AttachmentNames(),"UTF-8")

Wednesday, October 14, 2009

iPhone ToDo's and Notebook Access

I have had some questions recently  about which  version of the Domino server can run ITANA successfully.

Domino 8.5 will not work.

Domino 8.5.1 is required.

There are certain parts of SSJS that were not available in earlier versions of the Domino Server that I have taken advantage of.  I will write soon about what these are and how to use them in your applications. Since this application is built on X-pages, the server has to be Notes 8.5.1CD8 or newer, but because the Gold release is out for Domino 8.5.1 it would be better to be running production code.

__________________________________________________________________________

startup photo 3photophotocal   

If you would like more information on this product please visit, http://hughesconnect.com

Friday, October 9, 2009

Announcing ITANA or “iPhone Tasks and Notebook Access for Lotus Notes”

With the release of the Lotus Domino 8.5.1 server on Monday, I am making ITANA for Lotus Notes available for purchase.  This application will allow you to access you Lotus Notes To Do’s(Tasks), and your Lotus Notes Journal(Notebook) from your iPhone.  It does not require any modification to the mail file, and can run on a separate server than the users mail file.

It is an X-Page application, therefore there is not any offline access to your information.  I know some of you see this as a big limitation, but remember the iPhone is almost always connected to the internet, and on an airplane a laptop is always better to get work done on than an iPhone.

This product does require a Domino 8.5.1 server CD8 or Gold code to run correctly!

To purchase this product, or for more details and a demonstration video, please visit http://Hughesconnect.com .

Thursday, October 8, 2009

Xpages: Alternate View Row Colors Made Easy

This may be old news to some, but for me a tip from Paul Hannan made a big improvement to how my views look in X-Pages.

First open the view in designer on your x-page, then click on All Properties, look for rowClasses

enter in two or 3 classes like - even, odd

designer

now add some css to your style sheet

.odd {
background-color: rgb(248, 248, 248);
}

.odd:Hover {
background-color: rgb(288, 250, 221);
}

.even {

}
.even:Hover {
background-color: rgb(288, 250, 221);
}




That’s it, really simple alternate row colors in X-pages

The results will look something like this, depending on the contrast level on your screen you may or may not see the alternate line colors as they are very light gray with the hover color light yellow.

sample