[T]hat wonderful cheering welcome that President Obama received with his unscheduled surprise visit to the troops in Iraq, was entirely a staged event.
The troops were interrogated beforehand, with those military members who had voted for President Obama given identical digital cameras and placed in front of the media cameras covering the event.

According to Flopping Aces:
A sergeant who was there explained the subterfuge. “We were pre-screened, asked by officials ‘Who voted for Obama?’, and then those who raised their hands were shuffled to the front of the receiving line. They even handed out digital cameras and asked them to hold them up.”
What a wonderfully awesome idea — if, that is, you’re so scared you won’t get a warm reception from a military whose efforts you have spent your entire political career dissing and diminishing.