Thursday, October 28, 2010

xPage: Could not load 'imb.xsp.widget.layout.TypeAhead'

Does somenody saw such issue? Got it when added typeAhead to customer control. It works fine when I open new document, but when I go to edit mode always get such message, any ideas?

Monday, October 11, 2010

xPage: date picker does not work in IE8

Just found that standard date picker does not work properly in IE8 (it always refresh page when we click on date/time picker. That's not funny :/ question - why do all another browsers work fine?

Workaround
http://www-10.lotus.com/ldd/nd85forum.nsf/0/579744cf7198e21785257731006c9cea?OpenDocument

Thursday, September 16, 2010

Change encoding attribute after XLST

I've done some transformation my DXL using XSLT. The funny thing was that after transformation using


// Transform
var str = docxml.transformNode(xsl);


I always got 'encoding' as UTF-16, that's not correct, so after some time I found nice solution


here is code I used: http://dotnet.itags.org/dotnet-tech/66097/

var doc = new ActiveXObject("Microsoft.XMLDOM");
doc.load(
"test.xml");

// Print initial encoding
var pi = doc.firstChild;
var eattr = pi.attributes.getNamedItem("encoding");
var encoding = eattr.value;

// Convert to string and reload (this loses the encoding)
var xml = doc.xml;
doc.loadXML(xml);

// Reset the encoding to "ISO-8859-1"
pi = doc.firstChild;
var eattr = pi.attributes.getNamedItem("encoding");
if (eattr == null) {
eattr = doc.createAttribute(
"encoding");
pi.attributes.setNamedItem(eattr);
}
eattr.value =
"ISO-8859-1";

// And save document with new encoding.
doc.save("test2.xml");


It works fine for me (and not, output option in XSL did not help)

Wednesday, September 15, 2010

Date.prototype.addDays

I did not find that method how can I add days to my date, so here is solution:

// add days
Date.prototype.addDays = function(days) {
var secsDay = 86400000; // there are 86400000 secs in 1 day
var time = this.getTime(); // number of milliseconds since midnight of January 1, 1970.
var newdate = new Date(time + (days * secsDay));
this.setDate(newdate.getDate());
}


If anybody has better solution, you are welcome!

Tuesday, September 14, 2010

'wget' as way to download files

Need to download files from our Domino server by this path http://host/myfile.log, using MS DOS command?
You can try to use wget as one of possible way to do that.
here is an exmplae of DOS command:
wget.exe http://host/myfile.log
I've run this DOS command in my JS file (yes ActiveX is required for that), but anywhere it is quite interesting approach.