Thursday, September 18, 2008

SharePoint List Scalability

One-stop shopping for all things related to SharePoint list scalability and scalability in general.

Link saved for future use.

http://www.sharepointjoel.com/Lists/Posts/Post.aspx?ID=84

Wednesday, September 3, 2008

SearchBoxEx, FireFox and the Enter Key

Here's a problem with SearchBoxEx and FireFox that's easy to reproduce.

1) Create an out-of-the-box Publishing Portal. No customizations required.

2) With FireFox 2 or 3, go to the home page of the new site.

3) In the search box, enter a search phrase and press the enter key.

4) The home page simply refreshes instead of going to the search results page.

With IE 6/7 and Safari 3, everything works as expected. That is, the search results page is displayed.

I've reproduced this bug with three flavors of MOSS: MOSS RTM, with MOSS SP1 installed and finally with MOSS Infrastructure Update installed.

Looking at the traffic in Fiddler, it appears that *two* requests are being generated by FireFox. One to the search results page and one to the home page (in that order).

So...what's the fix?

After using http://www.rotary.com/ as inspiration, we came up with the following JavaScript that replaces the default key press event handler provided by MOSS.

To use the script, you'll need to supply the correct name of the submit method and input control id that is dynamically generated by SharePoint. After you do that, wrap the code in a script tag and place it on the page.

function replaceOnKeyPress()
{
var theFunction = "SDXXXXXXX_Submit();";
var theInputID = "ctl00_PlaceHolderSearchArea_SearchBox_SDXXXXXXX_InputKeywords";

var txt = document.getElementById(theInputID);
var browser=navigator.appName;

if (txt && (browser == "Netscape"))
{
txt.onkeypress = function(e)
{
var key = String.fromCharCode(e.keyCode);

if (key == "\n" key == "\r")
{
eval(theFunction);
return false;
}
}
}
}

replaceOnKeyPress();