3 Replies Latest reply on Jun 29, 2007 6:14 AM by kooudy

    facesMessages and element id

    kooudy

      I want add error message to a html input, but without success:

       @In
       private FacesMessages facesMessages;
      
      this.facesMessages.addFromResourceBundle(
       "testInputID",
       "value.missing",
       (Object[]) null
      );
      
      <h:selectOneMenu value="#{someValue}" id="testInputID">
       <f:selectItems value="#{someSelectItems}"/>
      </h:selectOneMenu>
      <h:message for="testInputID" styleClass="error"/>


      something wrong?

        • 1. Re: facesMessages and element id
          christian.bauer

          facesMessages.addToControlFromResourceBundle()

          • 2. Re: facesMessages and element id
            kooudy

            I use SEAM 1.1.6 and there is no such method ... yeah I can see, possible from version 1.2.....

            public void addFromResourceBundle(String id, javax.faces.application.FacesMessage.Severity severity, String key, Object... params)

            Add a templated FacesMessage to a particular component id by looking for the message template in the resource bundle.


            It is possible in this method is to add message to particular component, isn't?
            Or parameter id means something else?

            thanks

            • 3. Re: facesMessages and element id
              kooudy

              update:

              FacesMessages.addFromResourceBundle(....)

              assign to specific element using ID,

              doesn't work only in places where I am using jPDL.

              I use the same page (include) and same mechanism to add FacesMessagesand and it works in places where navigation is defined by pages.xml.

              Is there someone who has the same experience?

              thanks