I ran into an issue with the Id's of dynamically added components. The page initially has some components and on an action more components are added programatically from the action handler. None of the components have their Id's set. One of the newly added component is a commandlink with an action. After the page is rendered with the old and new components, clicking on the new command link does not raise the action event.
After debugging I found that, in apply request values phase for the components without Id's CreateUniqueId id called. This new id is different from the old Id and hence the event got ignored. To solve this issue why can't the generated Id be saved in the state of the component when it is being rendered the first time? With the Id saved the subsequent requests will not have to call createUniqueID and events don't get ignored. I would appreciate some inputs on this.

