TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
goran ljubic
NA
27
2.9k
pass urls selected items to aapplication page
May 23 2015 4:24 PM
i created ribbon button that pass url selected item on application page. my code is
var listitem = '';
var ctx = SP.ClientContext.get_current();
var hostaddress = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port;
var currentWeb = ctx.get_web();
ctx.load(currentWeb);
var currentListGuid = SP.ListOperation.Selection.getSelectedList();
var currentList = currentWeb.get_lists().getById(currentListGuid);
ctx.load(currentList);
var selectedItems = SP.ListOperation.Selection.getSelectedItems();
var k = '';
for (k in selectedItems)
{
listitem = currentList.getItemById(selectedItems[k].id);
ctx.load(listitem);
ctx.executeQueryAsync(Function.createDelegate(listitem, function ()
{
var leafUrl=listitem.get_fieldValues().FileRef;
itemUrl = hostaddress + leafUrl;
alert(itemUrl);
var options = {
url: '/_layouts/RibbonCopyMove/CopyMovePage.aspx?items=' + itemUrl,
tite: 'Move Documents',
allowMaximize: false,
showClose: true,
width: 600,
height: 500 };
SP.UI.ModalDialog.showModalDialog(options);
}), null);
}
i want pass urls of all selected items to application page. with my code when select one item i receive ok url but when i select two or more items i receive undefinied url. how i solve this situation?
Reply
Answers (
3
)
How can use anchor Tag title as a url address
Queries on ASP.NET Authentication as its not working