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:
I was wondering the simplest way to override this undesider bahavior.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'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


Reply With Quote
