Spread 4 slices of the bread lightly with mayonnaise, then with deviled ham.
Place a slice of cheese and a slice of onion on each.
Top with remaining bread slices.
Beat together eggs, sour cream, and salt.
Dip each sandwich in egg mixture.
Melt butter in large skillet over medium low heat.
Fry sandwiches till cheese melts, turning to brown evenly on both sides.
Cut each sandwich diagonally in half.