I have just released mAddressBook to OpenNTF for the new development competition.  You can sync any addressbook on your server to your phone with this application.  It works offline on iPhones and iPads and should work offline with Android as well.  There are two themes included, please let me know any comments you might have, thanks

 Download

 

Another trick to get your Xpage to load faster

On October 20, 2011, in Uncategorized, by Mark Hughes

I HATE  twisties on views on the web!!  I like to use combo-box’s at the top to filter the results.

Recently i ran into an issue getting the values for the combo-box’s.  You see, I used to just do a @DbCloumn to get the values then throw a @Unique() around that  to get my list.  And that seemed to work ok for small views, BUT in this application it had 100k documents and was taking 10-14 seconds to load the page.  I then rethought how I would get values from now on.

The first thing I did was create a new view with one column, the value i needed, and categorized it.  Next I changed the code in the computed values in the combobox to create an array, and use a ViewNavigator to get the values.

//get all end dates and then sort them

var arraydate = new Array()
var view1 = database.getView('enddates')

var nav:NotesViewNavigator = view1.createViewNav();
var entry:NotesViewEntry = nav.getFirst();
while (entry != null) {
	if (entry.isCategory()) {
		arraydate.push(entry.getColumnValues().firstElement().toString())
	}
	var tmpentry:NotesViewEntry = nav.getNextCategory();
	entry.recycle();
	entry = tmpentry;
}

//sort function for dates found on web somewhere
var dateRE = /^(\d{2})[\/\- ](\d{2})[\/\- ](\d{4})/;
function mdyOrdA(a, b){
a = a.replace(dateRE,"$3$1$2");
b = b.replace(dateRE,"$3$1$2");
if (a>b) return 1;
if (a <b) return -1;
return 0; }

arraydate.sort(mdyOrdA)

 

Notice the use of getNextCategory(), at fist i was using getNextEntry(date1), and that cut the load time in half, using getNextCategory() made it seem to load almost instantaneously.

Now if these values wouldn’t change very often(but they do), i would load this into an applicationScope and let the app check for its existence and only build it when the applicationScope expired.


 

 

 

My favorite 8.5.3 feature has a small flaw

On October 4, 2011, in Uncategorized, by Mark Hughes

Great news this seems to have been fixed in the Gold code!!  My errors were with 8.5.3 cd5

 

First This is one of my favorite features in 8.5.3, but there is on caveat i have found just this past weekend.

When “Use Runtime Optimized CSS an JS Resources”  is checked on the XPage tab on application properties,

and you have a css file that refferences an image like

background-image:url(‘./test.png’)

 

It will NOT display the image.

For some reason the browser thinks the image is a css file, and not an image.  It even puts it in a css named folder.  To get around this include those styles on the page instead of in a css file.  I will submit this to IBM to see if we can get it fixed.