We have a user interface for an object that has a tool or issuer, but both of them. You can select one of them from the pop-up search dialog box and assign its entities.
The user can see the number and name of each of the two next to the "Search ..." button. Both of these should be unavailable for editing, that is, we correspond <p:inputText ... readonly="true" ... />to the grayness of the inputs.
The requirement that we have now is that it is assumed that not only the validation message will not be displayed when neither or both instruments and issuers are selected, but also that the text fields with tags readonly="true"are shown in red (along with their labels )
When adding before clicking "Save":

When adding after clicking "Save":

I tried something and then ended up in OmniFaces <o:validateMultiple>, which seemed to be going in the right direction. However, I then noticed that the validator did not hit, as you can see from the images ... (I just deleted readonly="true"to see the effect)
Here is the code excerpt:
<h:panelGroup id="subpanel"
layout="block">
<o:validateMultiple id="instrument-or-issuer-validator"
validator="#{barrierCrossingManager.validateInstrumentOrIssuer}"
components="instrument-isin instrument-description issuer-number issuer-name"
message="..." />
...
<p:panelGrid id="issuer-subpanel">
<p:row>
<p:column>
<p:outputLabel for="issuer-number" value="#{msg['common.number.label']}:" />
</p:column>
<p:column colspan="3">
<p:inputText id="issuer-number"
value="#{barrierCrossingManager.selectedIssuer.nbr}"
readonly="false" />
</p:column>
...
</p:row>
</p:panelGrid>
...
<h:messages id="msgs"
layout="list"
styleClass="subcontent-validation-msg-wrapper"
showDetail="false"
showSummary="true" />
</h:panelGroup>
Q :
How do you solve this?
The problem is that OmniFaces or JSF (?) Do not perform read-only component validation. I also looked at OmniFaces VDL for <o:validateMultiple>, but there was no type flag allowReadOnlyComponentHighlightingor the like.
Is there another way?
source
share