[SOLVED] Show message on portlet when submit was successful

Hi everybody

I have a CAF portlet that starts a process, but whenever I fill it out and submit the data you can’t actually see on the page whether the data has been submitted or not. The page is just refreshed and often you can’t even see it if you don’t know that happens. Now I wanted to create a banner, like when you have an error, that says ‘Submit was successful’ or something like that.

Does anyone how to do this?

With kind regards
Kevin

Have a modal dialog inside your form and mention it in toggle section of the button which is submitting the data.
Inside modal dialog you can have a output text which can display information according to your success or failure.

Hey Anjini

That worked, thanks a lot :slight_smile:

The technique I like to use is to just have the action handler raise a new FacesMessage which is then automatically displayed to the user by the existing ‘Formatted Messages’ control at the top of my view when it is refreshed.

For example, in the java code of the action you can do something like this:

FacesMessage message = new FacesMessage(
    FacesMessage.SEVERITY_INFO,
    "Info Message Summary",
    "An informational message details."
    );
getFacesContext().addMessage(null, message);

Hey Eric

Thank you for your reply but seeing Anjini’s suggestion worked and I don’t really understand your suggestion I’m going to leave it be for now. My internship is ending this week so I’ll make sure that the person who will be my ‘successor’ will see your suggestion so he/she can make a decision to implement it or not.

Thanks again for showing interest.

Kind regards
Kevin