i have the following problem (perhaps a bug?): h:message for an input field will only be rendered, if no FacesMessage exists under the input field ID. On the other hand if i use p:message, an empty DIV will be generated, also if no FacesMessage exists.
In combination with Ultima-Theme this leads to a problem, because this DIV with class .ui-message is configured with min-height: 20px;. So also with no FacesMessage (f. e. for an error message) the next input field below will be shown 24px lower. This leads to very ugly FORMs if there are input fields with:
- No p:message attached
- Using h:message (but at least this really makes no sense)
- Input field with p:message not aligned below (f. e. at the right side or just as tooltip)
Code: Select all
<p:panelGrid columns="1">
<h:panelGroup styleClass="md-inputfield">
<p:password id="myValidatedInput" value="#{bean.input1}" required="true"/>
<h:outputLabel for="myValidatedInput" value="#{msg.validated_input}"/>
<p:message for="myValidatedInput"/>
</h:panelGroup>
<!-- Space = margin + message-min-height -->
<h:panelGroup styleClass="md-inputfield">
<p:password id="myOptionalInput" value="#{bean.input2}"/>
<h:outputLabel for="myOptionalInput" value="#{msg.optional_input}"/>
</h:panelGroup>
<!-- Space = only margin -->
<h:panelGroup styleClass="md-inputfield">
<p:password id="myValidatedInput2" value="#{bean.input3}"/>
<h:outputLabel for="myValidatedInput2" value="#{msg.validated_input}"
validator="myValidator"/>
<p:message for="myValidatedInput2"/>
</h:panelGroup>
...
Or is it really needed to have an empty DIV just wih no messages available?
Wbr,
Daniel