Results 1 to 3 of 3

Thread: FlowFacesContext ignoring messages detail and using summary instead

  1. #1
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    12

    Default 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 at 09:50 AM.

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    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
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    12

    Default

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

    Balder

Tags for this Thread

Posting Permissions

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