Results 1 to 3 of 3
  1. #1
    andree2014 is offline Member
    Join Date
    May 2014
    Posts
    7
    Rep Power
    0

    Default add message to growl message componnent in primefaces

    hello i have a jsf page it contains a message and a i want add message only to the growl message and it does not work for me :

    my jsf code is :



    public class EtudeBean {

    @Autowired
    private EtudeService etudeServiceImpl;
    @Autowired
    private LotissementService lotissementServiceImpl;
    private EtudeModel model = new EtudeModel();
    private Etude etude;

    private long lotissementIdEtude;

    public EtudeBean() {
    etude = new Etude();
    }

    public Lotissement trouverLotissement() {

    return lotissementServiceImpl.trouverLotissement(getLotis sementIdEtude());

    }

    public void save(){
    etude.setDesignation(model.getDesignation());
    etude.setDescription(model.getDescription());
    etude.setCout(model.getCout());
    etude.setDateRealisation(model.getDateRealisation( ));

    etude.setLotissement(model.getLotis());
    etude.setIdEtude(model.getIdEtude());
    etudeServiceImpl.modifierEtude(etude);
    FacesMessage msg=new FacesMessage(FacesMessage.SEVERITY_INFO,"Etude"+et ude.getDesignation()+"modifiée avec succes","Mot de passe ancienne non valide: ");
    FacesContext.getCurrentInstance().addMessage("grow l",msg);

    }

    and the code of my jsf page :

    <h:form id="form" prependId="false">
    <p:growl for="growl" id="idgrowl"/>
    <p:panel id="panel"
    header="New Etude for lotissment: #{etudeBean.trouverLotissement().nom}" >

    <p:messages id="msgs" />

    <h:panelGrid columns="9" style="margin-top:10px;">
    <h:outputLabel for="designation" value="Designation: *"
    style="margin-right: 34px;" />
    <p:inputText id="designation" value="#{etudeBean.model.designation}"
    required="true" label="Designation">
    <f:validateLength minimum="2" />
    </p:inputText>
    <p:message for="designation" display="icon" />


    <h:outputLabel for="dateRealisation" value="Date Realisation: * "
    style="margin-right: 34px;margin-left:34px;" />
    <p:calendar value="#{etudeBean.model.dateRealisation}"
    pattern="dd.MM.yyyy" />

    </h:panelGrid>

    <p:commandButton value="Save" update="panel"
    action="#{etudeBean.save()}" />
    </p:panel>
    </h:form>

    have one any idea please help me and thank you very much

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,354
    Rep Power
    6

    Default Re: add message to growl message componnent in primefaces

    Sigh. Yet another "It does not work".

    Lets make the list then.

    - "It does not work" is NOT a problem description you can get help with. What does not work? You get an error? Nothing happens? The growl appears but is empty? You get garbage on the screen? Your microwave starts to talk to you?

    - When you go to a forum you haven't been to yet, search around for forum guidelines so you may for example learn how to post formatted code. I hope you can agree that what you posted here is very hard to read

    - you neglect to mention you're using Primefaces which is actually the thing you're having trouble with, not JSF itself

    - You're not only using JSF are you? @Autowired seems to be a Spring annotation


    Please go through the Guide For New Members and BB Code List - Java Programming Forum - Learn Java Programming and learn how to post code in this forum.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    andree2014 is offline Member
    Join Date
    May 2014
    Posts
    7
    Rep Power
    0

    Default Re: add message to growl message componnent in primefaces

    i want add the info message only to the <p:growl for="growl" id="idgrowl"/> but the message is diplay in the <p:messages id="msgs" />

Similar Threads

  1. Object message
    By HMFouad in forum NetBeans
    Replies: 6
    Last Post: 06-12-2012, 11:29 AM
  2. Send XML message over UDP?
    By udpkillsme in forum XML
    Replies: 2
    Last Post: 06-22-2011, 07:25 PM
  3. Run message only once
    By aconti in forum New To Java
    Replies: 2
    Last Post: 06-01-2011, 09:19 PM
  4. Replies: 6
    Last Post: 06-04-2010, 09:43 PM
  5. Scroll message
    By getkiran in forum Java Applets
    Replies: 1
    Last Post: 03-05-2009, 05:29 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
  •