-
1. Re: How to display the custome FacesMessage...
blabno Jan 9, 2012 11:28 AM (in response to hantsy)hantsy,
In Seam2 you could not stop navigation with facesMessages. There was never such option.
Use navigation rules. They are meant for such cases. -
2. Re: How to display the custome FacesMessage...
hantsy Jan 9, 2012 10:26 PM (in response to hantsy)I promise the Seam 2 FacesMessages can prevent navigation...
public void sendMessage() { if (messageBox.getToAddress() == null || messageBox.getToAddress().trim().length() == 0) { facesMessages.add(Severity.ERROR, "to address is required."); return; } try { messageBox.send(); } catch (Exception ex) { return; } facesMessages.add(Severity.INFO, "Message is sent!"); Events.instance().raiseEvent( MessagingConstants.EVENT_LOAD_CONTENT_TEMPLATE, MessagingNavigationEnum.MESSAGE_BOX, MessagingNavigationEnum.MESSAGE_PAGE); }
This is the real code fragment from my before application(Seam 2.2). I used it frequently in the before application.
Using navigation rule will abandon the content in form...I have comments in the issues.
Any good idea for this problem?
-
3. Re: How to display the custome FacesMessage...
lightguard Jan 9, 2012 10:42 PM (in response to hantsy)Ignoring the fact that this method doesn't even compile... You're calling a void method, from I assume, an action method which will tell JSF to return to the same page. If you're thinking the Messaging* enums / Strings you have at the end do anything, there is no class in Seam with those names.
-
4. Re: How to display the custome FacesMessage...
hantsy Jan 9, 2012 10:46 PM (in response to hantsy)MessagingNavigationEnum is my custom class, not provided by Seam 2.
-
5. Re: How to display the custome FacesMessage...
hantsy Jan 9, 2012 10:49 PM (in response to hantsy)OK, ignore the FacesMessages now, I am using Seam 3.1.0Final now.
Using navigation rule will abandon the content in form...I have comments in the issues.
How to display a custom message effective in Seam3?
-
6. Re: How to display the custome FacesMessage...
lightguard Jan 9, 2012 11:21 PM (in response to hantsy)I must not be understanding something because it hasn't changed. You can still use FacesContext.addMessage(...) unless you have some redirect happening (but I think we should be supporting that).
-
7. Re: How to display the custome FacesMessage...
hantsy Jan 9, 2012 11:28 PM (in response to hantsy)Maybe I changed the programming style...in the Seam2 application, I used Ajax and event frequently...
In Seam 3, I avoided Ajax sometime, especially the partial page render(many problems I encountered, I have complained many times in this forum ).
Thanks.
-
8. Re: How to display the custome FacesMessage...
lightguard Jan 10, 2012 12:00 AM (in response to hantsy)
hantsy bai wrote on Jan 09, 2012 23:28:
Maybe I changed the programming style...in the Seam2 application, I used Ajax and event frequently...
In Seam 3, I avoided Ajax sometime, especially the partial page render(many problems I encountered, I have complained many times in this forum ).
Thanks.Yeah, JSF issues :( unfortunately we can't control AJAX in JSF or fix their bugs.