You need to create a method to handle the menu action. Something like this...
Code:
frame.popup = CreateFrame( "Frame", "$parent_Popup", frame, "UIDropDownMenuTemplate" );
frame.menu = function()
local popup = frame.popup;
if popup then
local anchor = frame.popup;
this.unit = frame:GetAttribute( "unit" );
this.name,
this.server = UnitName( this.unit );
ToggleDropDownMenu( 1, nil, popup, anchor, anchor:GetWidth()/2, anchor:GetHeight()/2 );
end
end