I believe there is a bug in inplace.isValid() related to the use of facets as I'm seeing the same issue. Here is the relevant code from the encodeMarkup method in InplaceRenderer. As you can see it does expect named facets of input and output.
protected void encodeMarkup(FacesContext context, Inplace inplace) throws IOException {
// ...
boolean validationFailed = context.isValidationFailed() && !inplace.isValid();
String displayStyle = validationFailed ? "none" : "inline";
String contentStyle = validationFailed ? "inline" : "none";
UIComponent outputFacet = inplace.getFacet("output");
UIComponent inputFacet = inplace.getFacet("input");
// ...
}
You can see the full code here: https://github.com/primefaces/primefaces/blob/master/src/main/java/org/primefaces/component/inplace/InplaceRenderer.java
Looking at isValid in InplaceTemplate, it looks like it only attempts validation on the immediate children of inplace and does not recurse down through its other descendants (unless getFacetsAndChildren flattens the descendant tree, which I'm researching now). Since facets aren't instances of EditableValueHolder then it doesn't even attempt validation on them and returns true. Here is the entire isValid method.
public boolean isValid() {
boolean valid = true;
for(Iterator<UIComponent> it = this.getFacetsAndChildren(); it.hasNext();) {
UIComponent component = it.next();
if(component instanceof EditableValueHolder && !((EditableValueHolder) component).isValid()) {
valid = false;
break;
}
}
return valid;
}
You can see the full code at https://github.com/primefaces/primefaces/blob/master/src/main/java-templates/org/primefaces/component/inplace/InplaceTemplate.java
I don't know as there's a solution to this beyond submitting a bug.
EDIT
<p:inplace id="inplace" editor="true">
<f:facet name="output">
<h:outputText value="#{bean.value}" />
</f:facet>
<f:facet name="input">
<p:inputText id="input" value="#{bean.value}" required="true" requiredMessage="Required field message goes here" />
<p:message for="input" />
</f:facet>
</p:inplace>
Updating it to something like this got us closer so it is possible that having multiple components within the facet is the problem.
<p:inplace id="inplace" editor="true">
<p:ajax event="save" update="message" />
<f:facet name="output">
<h:outputText value="#{bean.value}" />
</f:facet>
<f:facet name="input">
<p:inputText id="input" value="#{bean.value}" required="true" requiredMessage="Required field message goes here" />
</f:facet>
</p:inplace>
<p:message id="message" for="input" />
Unfortunately this still leaves a bit to be desired related to resetting the field and message when hitting cancel, but at least it's a step in the right direction for us.