Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: MVCPortlet, SessionMessages and Redirect
Hello, in my custom MVCPortlet I have a view.jsp file with inside a
form which calls a function in my portlet.java file.
After the
function, if everything is ok I'm calling the method
"SessionMessages.add(actionRequest,"success");" in
order to show a custom success message.
Everything works fine, but after the success message I need to redirect the user on another page. So I thought to add a simple redirect "actionResponse.sendRedirect(themeDisplay.getURLPortal());" after the method that shows the custom message. But in this way the redirect is too fast and I have no time to read the success message.
Which is the best way to show the custom success messagge, give to
user enought time to read it, and then redirect the page?
It
would be great if I can show the succes message in a popup, and only
when the user close the popup he will be redirected. Is this possible?
In this case, Use your success message in redirected page. i.e
<liferay-ui:success key="success" message="Greeting saved successfully!" /> in your redirected page. So, you can see the message in redirected page.
Powered by Liferay™