Reputation: 33551
There is a problem in SharePoint (both WSS3 and WSS2) that item registration and edit forms do not have the "autocomplete" feature in Internet Explorer.
That is, if you need the same value in some text field frequently, you have to type it manually. Internet Explorer does not provide you with drop-down list of values you have previously entered. In FireFox this thing works, however.
As I found out from this response to a similar question, it is because Internet Explorer disables auto-complete in pages which have "no-cache" or "expires" headers. SharePoint really does send non-cacheable pages to the client. This SO response also says that one should add autocomplete="on"
to the form
tag, it overrides the cache headers.
I edited the FORM element in "default master" page on my server to always include the autocomplete="on"
and - yes, autocomplete feature works!
However, Microsoft warns us NOT to edit the "default.master" as it will be overwritten by the next service pack or patch.
So, the question is - what are my options to correctly solve this situation? I want to have autocomplete to be enabled in whole server farm.
Upvotes: 0
Views: 3332
Reputation: 6988
However, Microsoft warns us NOT to edit the "default.master" as it will be overwritten by the next service pack or patch.
Copy & Paste new masterpage with different name and use it as the default one. Use either SharePoint designer or programmatically set SPWeb.MasterUrl and/or SPWeb.CustomMasterPage.
For this, i have 2 features
Project http://img251.imageshack.us/img251/7351/ss20100312093605.png (MWSBalticovo is for meeting workspace - they have a different masterpage)
I have a feature with my custom master page packaged:
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="BalticovoMasterPages" List="116" Url="_catalogs/masterpage" RootWebOnly="TRUE" Path="MasterPages">
<File Url="Balticovo.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
<Property Name="ContentType" Value="$Resources:core,MasterPage;"/>
<Property Name="MasterPageDescription" Value="$Resources:Balticovo,BalticovoMasterPageDescription;"/>
</File>
<File Url="MWSBalticovo.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
<Property Name="ContentType" Value="$Resources:core,MasterPage;"/>
<Property Name="MasterPageDescription" Value="$Resources:Balticovo,MWSBalticovoMasterPageDescription;"/>
</File>
</Module>
</Elements>
And FeatureReceiver:
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWeb web = properties.Feature.Parent as SPWeb;
string masterUrl = "/_catalogs/masterpage/Balticovo.master";
string mwsMasterUrl = "/_catalogs/masterpage/MWSBalticovo.master";
if (web.CustomMasterUrl.ToLower().Contains("/mws")) //meeting workspace
web.CustomMasterUrl = mwsMasterUrl;
else
web.CustomMasterUrl = masterUrl;
web.MasterUrl = masterUrl;
web.Update();
}
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPWeb web = properties.Feature.Parent as SPWeb;
web.MasterUrl = "/_catalogs/masterpage/default.master";
if (web.CustomMasterUrl.ToLower().Contains("/mws")) //meetng workspace
web.CustomMasterUrl = "/_catalogs/masterpage/MWSdefault.master";
else
web.CustomMasterUrl = "/_catalogs/masterpage/default.master";
web.Update();
}
elements.xml (activate 1st feature on newly created web's, but will not activate on existing):
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureSiteTemplateAssociation
TemplateName="GLOBAL"
Id="{227c6aed-f66b-482d-aea8-a2af3ca203b7}" />
</Elements>
FeatureReceiver (activate 1st feature on existing webs):
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
Guid masterPageFeatureId = new Guid("{227c6aed-f66b-482d-aea8-a2af3ca203b7}");
SPSite site = properties.Feature.Parent as SPSite;
SPWebCollection webs = site.AllWebs;
foreach (SPWeb web in webs)
{
try
{
if (web.Features[masterPageFeatureId] == null)
web.Features.Add(masterPageFeatureId);
}
catch (InvalidOperationException) //target feature not yet installed
{ throw; }
catch (SPException) { } //If feature could not be activated.
finally
{
if (web != null)
web.Dispose();
}
}
}
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
Guid masterPageFeatureId = new Guid("{227c6aed-f66b-482d-aea8-a2af3ca203b7}");
SPSite site = properties.Feature.Parent as SPSite;
SPWebCollection webs = site.AllWebs;
foreach (SPWeb web in webs)
{
try
{
if (web.Features[masterPageFeatureId] == null)
web.Features.Remove(masterPageFeatureId);
}
catch (InvalidOperationException) { }
catch (SPException) { }
finally
{
if (web != null)
web.Dispose();
}
}
}
Upvotes: 2