Search code examples
jsfwebsphere

Attribute 'for' of label error


I am using MyFaces JSF 2.0 - IBM implementation on WebSphere V8.0. In system out message I am noticing below error only after successful login by user.

HtmlLabelRend W   Attribute 'for' of label component with id j_id1610532955_33b1d0aa is not defined

I do not have any field named "id". Any pointer to resolve this issue will be useful


Solution

  • The h:outputLabel is used for labeling input components. It renders a label html tag.

    You are probably using h:outputLabel, and it's for attribute points to a component that doesn't exists.

    The value of the for attribute must be the ID of an existing component, that is, the component you want to label. For example:

    <h:outputLabel for="username" />
    <h:inputText id="username" value="#{bean.username}" />