XPages TypeAhead v2.0 with added fail icon

Thanks to Sven Hasselbach who inadvertently gave me the information I needed to intercept the ajax call in dojo.

http://stackoverflow.com/questions/9776503/xpages-get-the-contents-of-a-this-partialrefresh-ajax-call

Using

// --- hijack dojo XHR calls
dojo._xhr = dojo.xhr;
var loadOld;

function hijacked( response, ioArgs ){
   alert( response ); // change code here to do whatever you want. //
   loadOld( response, ioArgs ); // call the original function
}

dojo.xhr = function( mode, args, bool ){
    loadOld = args["load"];
    args["load"] = hijacked;
    dojo._xhr( mode, args, bool );
}

I was able to intercept the ajax call being made to the server. As I previously discussed in the original article I knew that the response was blank but was unable to get a handle on it – now I have.

There is also a NotesIn9 video supporting this article

Check out the  demonstration (Thanks to David Leedy for hosting)

http://watchtower.notesin9.com/xomino/xPlay.nsf/xTypeAhead.xsp

xTypeAhead with new Fail icon
xTypeAhead with new Fail icon
Advertisements

6 thoughts on “XPages TypeAhead v2.0 with added fail icon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s