SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am attempting to use LaunchPickerTreeDialog js method to launch the OOTB SharePoint list picker. It works fine when selecting a list within the current web application however if I pass a parameter for a separate web application the picker shows and allows me select a list but closing it does not fire my call back function. Does anyone know why?

share|improve this question
up vote 0 down vote accepted

Hard to tell without code, but I'll try to post you solution that works for me.

You have to add this code to aspx page where you'll use tree dialog (in my case it's copy.aspx):

<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
<SharePoint:ScriptLink ID="ScriptLink1" language="javascript" name="PickerTreeDialog.js" runat="server" />

Then add JS function definition:

function launchPicker() {
var host = location.protocol + "//" + location.hostname;
var url= "<%= SPContext.Current.Web.Site.Url %>";
var callback=function(arr)  {
    if(arr==null || arr==undefined)

    var x=document.getElementById("<%= TxtFolder.ClientID %>");
    x.value = host + arr[3];
LaunchPickerTreeDialog("RouterPickerSelectListTitle","RouterPickerSelectListText","websListsFolders","",url,"","","","/_layouts/images/Copy.gif", 0, callback, '', '' );


And then final code to use picker and control to store value in:

<table width="100%">
    <td width="100%">
        <wssawc:InputFormTextBox title="<%$Resources:wss,copy_enterfolder%>" class="ms-input" ID="TxtFolder" Columns="35" Runat="server" maxlength=255 size=60 width=100% />
        &nbsp;<input type="button" id="sendToBrowse" onclick="launchPicker();" value="..." />

This is not entirely my solution. I've found it weeks ago somewhere on internet and modified to meet my needs.

Hope it helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.