I had this happen to me too, and it really bugged me. There's a thin piece of foam that is sandwiched between the trim the the door panel. The foam rots away and causes the trim the separate. Here's what I did:
1) With a small flat-tip screwdriver, gently pry out the top edge of the trim.
2) I masked the area off with newspaper and masking tape.
3) Using an industrial strength spray adhesive, spray an even coat on both the loosened trim and the door panel. I used one made by 3M that I had left over from another project.
4) Let dry for a few minutes, then starting from the center of the trim and working to the outer edge, gently press the trim to the panel.
I'm really happy with the results.