Preheat oven to 350 degrees.
Melt butter in pan.
Add chopped onion,
And poppy seeds to melted butter.
Sauté until onions are soft.
Meanwhile, slice buns so that the bottoms and the tops stay intact. Place bottoms in a baking dish.
Spread onion mixture on buns, saving about 1/3 of the mixture for later.
Top with a layer of ham, followed by a layer of cheese, finishing with the tops of the buns.
Gently spread remaining onion mixture on top of buns
Cover with foil and bake for 20 minutes.