Monday, February 21, 2011

Popup not working properly with jquery

We had a problem with popup.Problem was as soon as page loads if we click 'Edit' hyperlink popup was coming,but after clicking check box/button in any other custom webpart that are available on the page,after that if we click on 'Edit' link popup was not coming up.From my TL i came to know the problem as popup is getting called in document.ready function.After any post back this function doesn't get called,popup should not be called in the document.ready function.For fixing this issue i got some Knowledge by go throughing the below link
http://geekswithblogs.net/venkatx5/archive/2010/11/17/how-to-open-a-page-in-sharepoint-2010-dialog-framework.aspx
After go throughing the above link
I have added the below function in the popup.js(path: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\xx\xx-js)

//User Defined Function to Open Dialog Framework
function OpenDialog(strPageURL)
{
var dialogOptions = SP.UI.$create_DialogOptions();
dialogOptions.url = strPageURL;// URL of the Page
dialogOptions.width = 750; // Width of the Dialog
dialogOptions.height = 500; // Height of the Dialog
dialogOptions.dialogReturnValueCallback = Function.createDelegate( null, CloseCallback); // Function to capture dialog closed event
SP.UI.ModalDialog.showModalDialog(dialogOptions); // Open the Dialog
return false;
}

// Dialog close event capture function
function CloseCallback(strReturnValue, target)
{
if (strReturnValue === SP.UI.DialogResult.OK) // Perform action on Ok.
{
alert("User clicked Ok!");
}
if (strReturnValue === SP.UI.DialogResult.cancel) // Perform action on Cancel.
{
alert( "User clicked Cancel!");
}
}
After this please change the code as below in the xxItemStyle.xsl in the template My Selection



Javascript:OpenDialog('');void('');

Recommendation to test the issue

1)Comment the code as below in the popup.js file(path: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\xx\xx-js)

//$(document).ready(function () {


// $('a.poplight').each(function () {
// var href = $(this).attr('href')
// href = '#' + href.substr(href.indexOf('?'), href.length).replace(/#/, '')

// $(this).attr('href', href)


// });

//});

2)After doing above code changes please do iisreset,delete the cookies,history from Internet Options and close that browser
3)Open another browser and test the issue

Thursday, February 17, 2011

This solution contains resources scoped for a Web application and must be deployed to one or more Web applications.

Hi,

Below you can see the error some times when you try to install the wsp



Then you can run the following command to install the wsp

The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started.

I got the below error when i was trying to create Managed Metadata Service
"The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator."
Finally it got resolved after making changes as mentioned in the below blog
http://sensoft2000-sharepoint.blogspot.com/2010/10/error-security-token-service-is-not.html

Wednesday, February 16, 2011

The document could not opened for editing.A Microsoft SharePoint Foundation compatible application could not found to edit the document

Hi,

I was getting error as below When I was trying to edit the master page



I have used the below option from Site Actions of the Site to edit the master page and then click 'All files' folder on left side and then select your master page. Then I am able to edit the master page of the site in designer