1 2 Previous Next 26 Replies Latest reply on Jun 30, 2010 4:42 AM by Bjørn T Johansen

    After upgrading to 3.3.3, messages is no longer displayed?

    Bjørn T Johansen Newbie

      I have the following code I use everywhere..:

       

      <rich:messages globalOnly="true" errorClass="errors" infoClass="info"/>

       

       

      and using a4j:commandbutton for the submit... In previous versions the messages was displayed as expected but in 3.3.3 they are not...

       

      Is this a bug or has something changed?

       

      I have also tried using the following..:

       

      <a4j:outputPanel id="pnlMessages" ajaxRendered="true">
          <rich:messages id="global_errors" globalOnly="true" errorClass="errors" infoClass="info"/>

      </a4j:outputPanel>

       

       

      But still no messages.....

       

      What am I missing?

       

       

       

      Regards,

       

      BTJ

        • 1. Re: After upgrading to 3.3.3, messages is no longer displayed?
          Bjørn T Johansen Newbie

          Forgot to mention that if I change a4j:commandbutton to h:commanbutton, the messages is of course displayed...

           

          BTJ

          • 2. Re: After upgrading to 3.3.3, messages is no longer displayed?
            Ilya Shaikovsky Master

            globalOnly="true" - means that only messages not attached to components will appears. if these ones failed to be shown?

             

            http://livedemo.exadel.com/richfaces-demo/richfaces/messages.jsf - working samples of messages attached to components.

            • 3. Re: After upgrading to 3.3.3, messages is no longer displayed?
              Bjørn T Johansen Newbie

              Yes, I know and I am using messages not attached to components... But as I said, this used to work... Also, using h:commandbutton displays the messages as it should...

              This appears to be an ajax rerender problem....

               

              And that the simple demo works is not the same as saying it works......

               

               

               

              BTJ

              • 4. Re: After upgrading to 3.3.3, messages is no longer displayed?
                Ilya Shaikovsky Master

                show code related to messages generation.

                • 5. Re: After upgrading to 3.3.3, messages is no longer displayed?
                  Bjørn T Johansen Newbie

                  This is the code I use...:

                   

                  protected void addMsgError(String summary)
                      {
                          FacesMessage facesMessage = new FacesMessage(summary);
                          facesMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
                          getFacesContext().addMessage(null, facesMessage);
                      }

                   

                   

                  But again, this works when using h:commandbutton, so I can't see any other reasons than that this is related to RichFaces and rerendering..?

                   

                   

                  BTJ

                  • 6. Re: After upgrading to 3.3.3, messages is no longer displayed?
                    Ilya Shaikovsky Master

                    you using Final version?

                     

                    I just added

                     

                    <a4j:form>
                    <h:panelGrid columns="3" styleClass="gridhello" columnClasses="gridhellocolumn">
                    <h:outputText value="Name:" />
                    <h:inputText value="#{userBean.name}" />
                    <a4j:commandButton value="Say Hello" 
                    action="#{userBean.action}"/>
                    <rich:messages globalOnly="true" errorClass="errors" infoClass="info"/>
                    </h:panelGrid>
                    </a4j:form>
                    

                     

                    and

                     

                         public String action() {
                            FacesMessage facesMessage = new FacesMessage("test message");
                            facesMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
                            FacesContext.getCurrentInstance().addMessage(null, facesMessage);
                            return null;
                         }
                    
                    and see message after clicking button.

                    • 7. Re: After upgrading to 3.3.3, messages is no longer displayed?
                      Bjørn T Johansen Newbie

                      Yes, I use the final version... And again, such simple example might work as it should but it does not work for my app...

                       

                      I use Facelets and JSF 1.2.x and the whole xhtml file looks like this..:

                       

                       

                      <?xml version="1.0" encoding="ISO-8859-1"?>
                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
                            xmlns:ui="http://java.sun.com/jsf/facelets"
                            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">
                      
                      <body>
                      <ui:composition template="common/layout.xhtml">
                          <style type="text/css">
                              .tooltip {
                              /*background-color: #b8ccd3;*/
                                  background-color: #cccccc;
                                  border: 1px solid black;
                                  padding: 2px;
                              }
                          </style>
                          <ui:define name="top">
                              <ui:include src="common/header.xhtml"/>
                          </ui:define>
                          <ui:define name="menu">
                              <ui:include src="common/menu.xhtml"/>
                          </ui:define>
                          <ui:define name="content">
                              <h:form id="form_action">
                                  <br/>
                                  <!--<a4j:outputPanel id="pnlMessages" ajaxRendered="true">-->
                                      <rich:messages id="global_errors" globalOnly="true" errorClass="errors" infoClass="info"/>
                                      <!--<h:messages id="global_errors" globalOnly="true" errorClass="errors" infoClass="info"/>-->
                                  <!--</a4j:outputPanel>-->
                                  <br/>
                                  <h:outputText value="Velg leverandør" style="font-size:larger; color:darkgray;"/>
                                  <h:outputText value="-->" style="font-size:larger; font-weight:bolder;"/>
                                  <h:outputText value="Velg betingelse" style="font-size:larger; color:darkgray;"/>
                                  <h:outputText value="-->" style="font-size:larger; font-weight:bolder;"/>
                                  <h:outputText value="Kalkuler priser" style="font-size:larger; font-weight:bolder;"/>
                                  <br/><br/>            
                                  <hr/>
                                  <br/>
                                  <h:panelGrid columns="2">
                                      <rich:column>
                                          <h:outputText id="focusfield" value="#{msgs.image}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:graphicImage id="art_image" url="#{nobbWizzardController.articleImageURL}" height="64"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.article_number}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.vare.varenummer}"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.article_texts}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <a4j:repeat value="#{nobbWizzardController.vare.varetekster}" var="varetekst">
                                              <h:outputText value="#{varetekst}"/><br/>
                                          </a4j:repeat>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.article_group}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.vare.varegruppe.readableText}"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.nobb_number}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.vare.nobbNr}"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.supplier}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.chosenPrice.leverandor.navn}"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.betingelse}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.chosenBetingelse.descriptiveText}:" rendered="#{nobbWizzardController.chosenBetingelse != null}"/>
                                          <h:outputText value="#{msgs.none_chosen}" rendered="#{nobbWizzardController.chosenBetingelse == null}"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.baseunit}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.chosenPrice.enhet.enhetkode.enhetkode}"/>
                                          <h:outputText value=" - "/>
                                          <h:outputText value="#{nobbWizzardController.chosenPrice.enhet.enhetkode.beskrivelse}"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.nobb_price}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.chosenPrice.nobbPris}">
                                              <f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                                          </h:outputText>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.discount}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.rabatt}">
                                              <f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                                          </h:outputText>
                                          <h:outputText value="%"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.article_inprice}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.chosenPrice.innkjopsPris}">
                                              <f:convertNumber maxFractionDigits="4" minFractionDigits="2"/>
                                          </h:outputText>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.paaslag}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{nobbWizzardController.chosenPrice.paaslag.descriptiveText}"/>                                            
                                      </rich:column>
                                  </h:panelGrid>
                                  <br/>
                                  <h:panelGrid id="prisgrid" columns="#{nobbWizzardController.totalCols}" width="60%" cellspacing="0" cellpadding="0">
                                      <rich:column/>
                                      <rich:column>
                                          <h:outputText value="#{msgs.Verk}" style="font-weight:bold;"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <h:outputText value="#{msgs.Storage}" style="font-weight:bold;"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <h:outputText value="#{msgs.vekting}" style="font-weight:bold;"/>
                                          <br/>
                                          <h:outputText value="#{msgs.storage}" style="font-weight:bold;"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <h:outputText value="#{msgs.vekting}" style="font-weight:bold;"/>
                                          <br/>
                                          <h:outputText value="#{msgs.verk}" style="font-weight:bold;"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <h:outputText value="#{msgs.calculated}" style="font-weight:bold;"/>
                                          <br/>
                                          <h:outputText value="#{msgs.kost}" style="font-weight:bold;"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.kostpris_faktor}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:inputText id="kostprisfaktor" value="#{nobbWizzardController.chosenPrice.paaslag.kostPrisPaaslag}" size="10" maxlength="10"
                                                       disabled="#{nobbWizzardController.notRoleAdminNorNOBB2}" style="text-align: right;">
                                              <!--<f:convertNumber maxFractionDigits="4" minFractionDigits="4"/>-->
                                              <f:converter converterId="no.asp.as.Double"/>
                                              <a4j:support event="onchange" reRender="prisgrid" focus="kostpris" ajaxSingle="true" action="#{nobbWizzardController.calcLagerVekting}"/>
                                          </h:inputText>
                                          <rich:message for="kostprisfaktor" errorClass="errors"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" >
                                          <h:inputText id="kostprisfaktorlager" value="#{nobbWizzardController.masterVare.basisEnhet.lagerPris.kostprisPaaslag}" size="10" maxlength="10"
                                                       disabled="true" style="text-align: right;">
                                              <f:convertNumber maxFractionDigits="4" minFractionDigits="4"/>
                                          </h:inputText>                    
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-left: solid red 1px; border-top: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-top: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-top: solid red 1px; border-right: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.article_costprice}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:inputText id="kostpris" value="#{nobbWizzardController.chosenPrice.kostpris}" size="10" maxlength="10"
                                                       disabled="#{nobbWizzardController.notRoleAdminNorNOBB2}" style="text-align: right;">
                                              <!--<f:convertNumber maxFractionDigits="3" minFractionDigits="2"/>-->
                                              <f:converter converterId="no.asp.as.Double"/>
                                              <a4j:support event="onchange" reRender="prisgrid" focus="salgsprisfaktor" ajaxSingle="true" action="#{nobbWizzardController.calcLagerVekting}"/>
                                          </h:inputText>
                                          <rich:message for="kostpris" errorClass="errors"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <h:inputText id="kostprislager" value="#{nobbWizzardController.masterVare.basisEnhet.lagerPris.kostpris}" size="10" maxlength="10"
                                                       disabled="true" style="text-align: right;">
                                              <f:convertNumber maxFractionDigits="3" minFractionDigits="2"/>
                                          </h:inputText>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-left: solid red 1px;">
                                          <h:inputText id="vektinglager" value="#{nobbWizzardController.vekting}" size="10" maxlength="10"
                                                       disabled="#{nobbWizzardController.notRoleAdminNorNOBB2}" style="text-align: right;">
                                              <!--<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>-->
                                              <f:converter converterId="no.asp.as.Float"/>
                                              <f:validateDoubleRange minimum="0" maximum="100"/>
                                              <a4j:support event="onchange" reRender="prisgrid" focus="btnSave" ajaxSingle="true" action="#{nobbWizzardController.calcLagerVekting}"/>
                                          </h:inputText>
                                          <rich:message for="vektinglager" errorClass="errors"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" >
                                          <h:inputText id="vektingverk" value="#{100 - nobbWizzardController.vekting}" size="10" maxlength="10"
                                                       disabled="true" style="text-align: right;">
                                              <f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                                          </h:inputText>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-right: solid red 1px;">
                                          <h:inputText id="beregnetkost" value="#{nobbWizzardController.beregnetKostpris}" size="10" maxlength="10"
                                                       disabled="true" style="text-align: right;">
                                              <f:convertNumber maxFractionDigits="3" minFractionDigits="2"/>
                                          </h:inputText>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.salgspris_faktor}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:inputText id="salgsprisfaktor" value="#{nobbWizzardController.chosenPrice.paaslag.salgsPrisPaaslag}" size="10" maxlength="10"
                                                       disabled="#{nobbWizzardController.notRoleAdminNorNOBB2}" style="text-align: right;">
                                              <!--<f:convertNumber maxFractionDigits="4" minFractionDigits="4"/>-->
                                              <f:converter converterId="no.asp.as.Double"/>
                                              <a4j:support event="onchange" reRender="prisgrid" focus="salgspris" ajaxSingle="true" action="#{nobbWizzardController.calcLagerVekting}"/>
                                          </h:inputText>
                                          <rich:message for="salgsprisfaktor" errorClass="errors"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <h:inputText id="salgsprisfaktorlager" value="#{nobbWizzardController.masterVare.basisEnhet.lagerPris.salgsprisPaaslag}" size="10" maxlength="10"
                                                       disabled="true" style="text-align: right;">
                                              <f:convertNumber maxFractionDigits="4" minFractionDigits="4"/>
                                          </h:inputText>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-left: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-right: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.article_salesprice}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:inputText id="salgspris" value="#{nobbWizzardController.chosenPrice.salgspris}" size="10" maxlength="10"
                                                       disabled="#{nobbWizzardController.notRoleAdminNorNOBB2}" style="text-align: right;">
                                              <!--<f:convertNumber maxFractionDigits="3" minFractionDigits="2"/>-->
                                              <f:converter converterId="no.asp.as.Double"/>
                                              <a4j:support event="onchange" reRender="prisgrid" focus="dg" ajaxSingle="true" action="#{nobbWizzardController.calcLagerVekting}"/>
                                          </h:inputText>
                                          <rich:message for="salgspris" errorClass="errors"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <h:inputText id="salgsprislager" value="#{nobbWizzardController.masterVare.basisEnhet.lagerPris.salgspris}" size="10" maxlength="10"
                                                       disabled="true" style="text-align: right;">
                                              <f:convertNumber maxFractionDigits="3" minFractionDigits="2"/>
                                          </h:inputText>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-left: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-right: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:outputText value="#{msgs.article_dg}:"/>
                                      </rich:column>
                                      <rich:column>
                                          <h:inputText id="dg" value="#{nobbWizzardController.chosenPrice.dg}" size="10" maxlength="10"
                                                       disabled="#{nobbWizzardController.notRoleAdminNorNOBB2}" style="text-align: right;">
                                              <!--<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>-->
                                              <f:converter converterId="no.asp.as.Double"/>
                                              <a4j:support event="onchange" reRender="prisgrid" focus="vektinglager" ajaxSingle="true" action="#{nobbWizzardController.calcNewDG}"/>
                                          </h:inputText>
                                          <rich:message for="dg" errorClass="errors"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}">
                                          <h:inputText id="dglager" value="#{nobbWizzardController.masterVare.basisEnhet.lagerPris.dg}" size="10" maxlength="10"
                                                       disabled="true" style="text-align: right;">
                                              <f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                                          </h:inputText>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-left: solid red 1px; border-bottom: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-bottom: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                      <rich:column rendered="#{nobbWizzardController.masterVare != null}" style="border-right: solid red 1px; border-bottom: solid red 1px;">
                                          <rich:spacer width="1"/>
                                      </rich:column>
                                  </h:panelGrid>
                                  <br/>
                                  <br/>
                                  <!--<a4j:commandButton id="btnSave" value="#{msgs.button_save}" action="#{nobbWizzardController.save}"/>-->
                                  <h:commandButton id="btnSave" value="#{msgs.button_save}" action="#{nobbWizzardController.save}"/>
                      
                                  <div style="background-color: yellow; width: 300px; position: absolute; right: 110px; top: 200px; border-bottom: solid 3px; border-left: solid 1px; border-right: solid 3px; border-top: solid 1px;">
                                      <p style="margin-bottom: 24px; margin-top: 24px; margin-left: 16px; margin-right: 16px;">
                                          <h:outputText value="#{msgs.avtale_tekst}:"/>
                                          <br/>
                                          <h:outputText value="#{nobbWizzardController.chosenPrice.leverandor.tekst}"/>
                                      </p>
                                  </div>
                              </h:form>
                          </ui:define>
                              <ui:define name="footer">
                                  <!--<ui:include src="common/footer.xhtml"/>-->
                              </ui:define>
                      </ui:composition>
                      </body>
                      </html>
                      
                      

                       

                       

                      BTJ

                      • 8. Re: After upgrading to 3.3.3, messages is no longer displayed?
                        Ilya Shaikovsky Master

                        please add rich:messages without any attributes. And check the same a4j:commandButton. Do you see any messages at all there?

                         

                        If not helps it would be good to have separated war sample for investigation.

                        • 9. Re: After upgrading to 3.3.3, messages is no longer displayed?
                          Bjørn T Johansen Newbie

                          Tried rich:messages without any attributes but still no messages....

                          But what do you mean with "Check the same a4j:commandButton"?

                           

                          I'll see if I can make an example where I can reproduce this...

                           

                           

                          BTJ

                          • 10. Re: After upgrading to 3.3.3, messages is no longer displayed?
                            Bjørn T Johansen Newbie

                            I have created a sampl app with the same flaws, do you want it on email or?

                             

                            BTJ

                            • 11. Re: After upgrading to 3.3.3, messages is no longer displayed?
                              Ilya Shaikovsky Master

                              if it's maven based and has small size - just attach to the thread. or if large - upload to sendspace.com please.

                              • 12. Re: After upgrading to 3.3.3, messages is no longer displayed?
                                Bjørn T Johansen Newbie

                                Is it ok for you to just download the file from here?

                                 

                                http://www.havleik.com/RFTest.tar.bz2

                                 

                                 

                                 

                                BTJ

                                • 14. Re: After upgrading to 3.3.3, messages is no longer displayed?
                                  Ilya Shaikovsky Master

                                  sorry.. missed the thread. thanks for bringin this up.. downloading..

                                  1 2 Previous Next