MyFaces Commons
  1. MyFaces Commons
  2. MFCOMMONS-27

CLONE - Its not possible to change the summary/ detail message of a ParametrizableFacesMessage

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.0.2
    • Component/s: myfaces-commons-utils
    • Labels:
      None

      Description

      We are using a PhaseListener in the render response phase to change the summary message of a FacesMessage

      public void beforePhase(PhaseEvent phaseEvent) {
         ...
        Iterator componentMessages = facesContext.getMessages(clientId);
      
         while (componentMessages.hasNext()) {
           FacesMessage message = (FacesMessage)componentMessages.next();
           StringBuilder builder = new StringBuilder();
           builder.append(label);
           builder.append(message.getSummary());
           message.setSummary(builder.toString());
        }
      }
      

      The problem is that since MyFaces 1.1.8 a ParametrizableFacesMessage is used for required messages. While doing a getSummary() the _evaluatedSummary is evaluated once, so effectively you can not change the _evaluatedSummary after one call to getSummary().

      My questions:
      1. Is this desired behaviour?
      2. In MyFaces 1.1.7 a FacesMessage was used instead of a ParametrizableFacesMessage, is there a configurable way to runtime use a FacesMessage instead of a ParametrizableFacesMessage?
      3. I suppose another workaround would be to add a label argument to each component which will be evaluated by the ParametrizableFacesMessage, is there any documentation how this functionality is intended to work?

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Leonardo Uribe
              Reporter:
              Jerry Meurs
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development