I have defined this:
<ui:define name="content">
<section id="documents">
....
<h:message for="documents" errorClass="errorc" />
</section>
This is inside a <body><main>
tags in the upper template.
Then my controller does this:
} catch (MyException e) {
ctx.addMessage("documents", new FacesMessage(FacesMessage.SEVERITY_ERROR, "Trying to raise an error", null));
}
But the error is not shown in the h:message
. I assume I am using wrongly the target ID, but I don't know how to do it. I have tried to move the h:message
outside the section but doesn't work either.
I could only make it work with general h:messages with null client ID