how the clientid is generated ?

I have a PhaseListener class that adds an HtmlOutputText to a grid on a page. On the first postback, all of these HtmlOuputText components are displayed correctly. On the 2nd postback of that same page, I got and exception of non-unique client id. myform:_id0.

If I manually generate the IDs then I do not get that error.

I thought the application instance would generate the appropriate IDs automatically by checking all the IDs on the ViewRoot. Or does this mean the application will "forget" the IDs after the life cycle finishes and starts over for the next cycle?

Thanks for your advice,

Vu

[626 byte] By [vuqphama] at [2007-11-26 13:17:57]
# 1
During which phase are you adding this HtmlOutputText?
BalusCa at 2007-7-7 17:42:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi,

Default component ids are set by the jsf implementation. And i always run in "duplicated ids" trouble when switching of implementation.

I hadn't time to think about it. May be someone has a best practice for component ids?

- A best practice would be to never trust the default implentation mechanism and always set the ids?

trevorijonesa at 2007-7-7 17:42:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
I add those components before and after each phase ( from 1 to 6 ) as long as ViewRoot is not null and it has the grid component that I add to the jsp page.Vu
vuqphama at 2007-7-7 17:42:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...