Hi erwanpia
If i were you, i wouldn't modify the AttachedFile directly. You'll have a hard time updating to another version of the HasManyFileManager if you mix in your own code. I recommend that you implement your own Decorator as described in the documentation (see the MyFile Source-code example). You can then put that code into your mysite/code directory, this way you have all your code nicely bundled in one directory.
Concerning your problem: That's most likely because there aren't all required JavaScript Libraries loaded inside the iframe. I'm afraid some of the form fields won't work inside the iframe due to JavaScript Libs that are missing. You could add them to the AttachedFile_Uploader::iframe method, but that would be a hack once again :)
If you don't have too many pages, you can solve it with a regular dropdown. like this:
public function getMyCMSFields(){
$items = DataObject::get('SiteTree');
$values = array();
foreach($items as $item){
$values[$item->ID] = $item->Title;
}
$fields = new FieldSet(
new TextField('Title', _t('AttachedFile_Uploader.TITLE', 'Title'),($this->owner->ID) ? $this->owner->Title : ""),
new TextField('DestLink', _t('DestLink', 'DestLink'),($this->owner->ID) ? $this->owner->DestLink : ""),
new DropdownField('LinkToID', _t('RedirectorPage.YOURPAGE', "Page"), $values, $this->owner->LinkToID)
);
return $fields;
}