Dynamically created component Id is changed during render response phase

Hello,

I am using myfaces 1.1.1

I have a UIInput bound to a backing bean as follows:

<h:inputText binding="#{MyBean.input}"

In MyBean I have the following:

public UIComponent getInput()

{

if (null == input)

{

FacesContext context = FacesContext.getCurrentInstance();

Application app = context.getApplication();

input = (UIInput) app.createComponent UIInput.COMPONENT_TYPE);

input.setId("someid");

}

return input;

}

publicvoid setInput(UIComponent input)

{

this.input = (UIInput)input;

}

During the render repsonse phase, the component id which was specified after creation using component.setId("someid") is replaced with a new id which looks something like "_id1". This was determined by implementing MyBean as a phaseListener and visually inspecting the UIViewRoot in beforePhase and afterPhase. Because the id is replaced any dynamically created Messages that may be bound to the input via the Message for attribute are now broken.

I am aware of the restrictions on setId() and am adhering to them

Must not be a zero-length String

First character must be a letter or an underscore ('_').

Subsequent characters must be a letter, a digit, an underscore ('_'), or a dash ('-').

The specified identifier must be unique

Any suggestions would be greatly appreciated.>

[1850 byte] By [mrausch1a] at [2007-10-2 7:22:52]
# 1
I am also interested in understanding why this happens. It makes it difficult to search for the component using findComponent()
Silmendila at 2007-7-16 20:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...