Results 1 to 2 of 2
  1. #1
    kaga01 is offline Member
    Join Date
    Sep 2010
    Posts
    1
    Rep Power
    0

    Default Error message does not display

    When i searched the forum for this problem i found a few posts but none seemed to fit exactly what is happening with my app. I have paired my application down to one field on the page and a few java statements to remove the clutter. I am using jdk 1.5/Seam/Hibernate set up. I am have some java experience but very new to seam. I am trying to display an error message.....doesn't seem like much of a task. When I have <h:messages/> at the top of the xhtml the message appears at the top of the displayed page. When i remove <h:messages/> i get no message displayed. In the console i get the message: 11:13:53,236 INFO [lifecycle]
    WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
    sourceId=null[severity=(INFO 0), summary=(Billing Address cannot be removed), detail=(Billing Address cannot be removed)]. I think the issue is that the sourceid is null and is not presenting the id or key of the message to the xhtml so it can be paired up with the message i have defined.

    I am embarrased to say exactly how long i have fooled with this problem. I would certainly appreciate any help. I am new to the forum i guess i will paste the code into this message below instead of attach. There is not much to see:


    public void validateFFSCompany() {
    facesMessages.addToControl("test", "Billing Address cannot be removed");
    }


    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:h="http://java.sun.com/jsf/html">
    <rich:panel>
    <f:facet name="header">
    <hutputText value="Search Events"/>
    </f:facet>

    <h:form>
    <fieldset style="width: 750px">

    <s:decorate>
    <hutputLabel for="test" value="Test 1: "/>
    <h:inputText id="test" value="#{mailingAddress.line1}" size="35" maxlength="35" required="false"/>
    <br/>
    <h:message for="test" styleClass="message"/>
    </s:decorate>
    </fieldset>

    <div class="spacer">
    <rich:spacer width="1" height="20"/>
    </div>

    <rich:toolBar>
    <rich:toolBarGroup>
    <h:commandButton value="Submit" id="submit" action="addFFSCompany" rendered="#{ffsCompany.id == 0}"/>
    <h:commandButton value="Edit" id="edit" action="editFFSCompany" rendered="#{ffsCompany.id != 0}"/>
    <s:button value="Cancel" id="cancel" action="cancelModifyFFSCompany"/>
    </rich:toolBarGroup>
    </rich:toolBar>
    </h:form>


    </rich:panel>
    </ui:composition>

  2. #2
    madnaelo is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default

    Give your form an id: like
    <h:form id='ffsCompanyForm'>

    and in java file,
    facesMessages.addToControl("ffsCompanyForm:test", "Billing Address cannot be removed");

    This should help?

Similar Threads

  1. Replies: 13
    Last Post: 03-20-2010, 01:03 AM
  2. Error Message????
    By Cubba27 in forum New To Java
    Replies: 11
    Last Post: 11-21-2009, 02:46 PM
  3. Display Message Without Throwing Exception
    By kailashchandra in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 09-27-2008, 09:05 AM
  4. Display success message in same page when submit button is clicked
    By am17mu in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 03-29-2008, 10:56 AM
  5. error message on jsp
    By sandor in forum Web Frameworks
    Replies: 1
    Last Post: 04-11-2007, 02:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •