Announcement Announcement Module
Collapse
No announcement yet.
FlowFacesContext ignoring messages detail and using summary instead Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FlowFacesContext ignoring messages detail and using summary instead

    Hi everyone!

    I'm working in a JSF application and we're integrating SWF2 using JSF-centric approach. Now I'm facing a simple yet annoying issue: the addMessage() method in FlowFacesContext class builds JSF validation/conversion messages ignoring the message detail and using only the message summary:
    Code:
    	/**
    	 * Translates a FacesMessage to an SWF Message and adds it to the current MessageContext
    	 */
    	public void addMessage(String clientId, FacesMessage message) {
    		MessageBuilder builder = new MessageBuilder();
    		StringBuffer msgText = new StringBuffer();
    		if (StringUtils.hasText(message.getSummary())) {
    			msgText.append(message.getSummary());
    		}
    
    		String source = null;
    		if (StringUtils.hasText(clientId)) {
    			source = clientId;
    		}
    
    		if (message.getSeverity() == FacesMessage.SEVERITY_INFO) {
    			builder.source(source).defaultText(msgText.toString()).info();
    		} else if (message.getSeverity() == FacesMessage.SEVERITY_WARN) {
    			builder.source(source).defaultText(msgText.toString()).warning();
    		} else {
    			builder.source(source).defaultText(msgText.toString()).error();
    		}
    		context.getMessageContext().addMessage(builder.build());
    	}
    I was wondering the simplest way to override this undesider bahavior.

    I've found a path, but it seems to be too "complicated", since it requires overriding four classes (FlowFacesContext, JsfView, JsfViewFactory, JsfViewFactoryCreator) and setting faces:flow-builder-services tag to use my custom JsfViewFactoryCreator to achieve what I want. I guess what I need is MyCustomJsfView's processUserEvent() and render() methods using my CustomFlowFacesContext, am I right?

    Am I missing something? Any help will be welcome! Thanks

    Balder
    Last edited by baldercm; Jul 30th, 2008, 10:50 AM.

  • #2
    Yes, this is a issue in 2.0.2 fixed in 2.0.3. 2.0.3 snapshots are currently available via the nightly build area, and should be out generally this week.

    Regards,

    Keith

    Comment


    • #3
      Ok, thanks for the help. I'll watch the new 2.0.3 release to see how you implement the solution.

      Balder

      Comment

      Working...
      X