When I'm iterating through building a new page, I often get "duplicate Id for a component" while constructing pieces of the page. When I get this, I have to guess where I'm having an "id" problem. I've never actually specifically set two fields with the same "id" value, this error only really happens when the framework generates two fields that result in the same "id" value. The problem is, how the heck do you figure out what you did wrong that produces that error? I usually have to hunt around on the whole page to figure this out.
I am not too sure whether this would help you or not. One plausible solution what i can think of is, don't let the runtime generate an id for your component. You try to always associate an id with the component.
Raghavan Muthu is right you always try to set the ID of a component when you create this. what i normally do is setting the Id to the component name+ line number where its located. but you can come up with your own style