views:

4579

answers:

1

Hey Guys,

Is there a way to show the multi friend selector widget (fb:multi-friend-selector) in an fb:dialog?

I have a button, on selecting which I would like to show the friend selector popup and users can send invite to their friends. I got the friend selector working on the main page but have no clue on how to display that widget in fb:dialog.

Thanks Jugs

+1  A: 

You'll have to edit this, but here's a jist:

popupInviteFriends : function (e) { if (e) { e.preventDefault(); }

    var fbml = '<fb:request-form \
                    action="." \
                    method="GET" \
                    invite="true" \
                    type="TWO" \
                    content="This is an invitation from ' + TWOFace.BRAND + '. \
                             &lt;fb:req-choice url=\'' + TWOFace.INVITE_DIALOG.postBack + '\' \
                                  label=\'Join ' + TWOFace.BRAND + '\' /&gt;"> \
                    <fb:multi-friend-selector \
                        showborder="false" \
                        rows="4" \
                        actiontext="Invite your friends to use ' + TWOFace.BRAND + '"> \
                    </fb:multi-friend-selector> \
                </fb:request-form';

    var container           = document.createElement('div');
        container.innerHTML = fbml;
    var inviteIFrame        = new FB.UI.PopupDialog(TWOFace.INVITE_DIALOG.title, container);

    inviteIFrame.setContentWidth(590);
    inviteIFrame.setContentHeight(400);
    inviteIFrame.show();
},
Michael Behan