no it's not possible to return anything from method in your case. JSF actions could only return navigation outcome strings. but check there the code we widelly using:
in this sameple facesContext.maximumSeverity used in order to close the panel conditionally and in your case it should be used in order to show.
Thank you very much.