0

I am using IBM JSF 1.2 and I've realized that validator wouldn't fire on disabled field.
Here is the snippet:

<h:outputLabel id="lblContainerGoesOnShip" styleClass="outputLabel"
    value="#{msg.lblContainerGoesOnShip}" for="inputContainerGoesOnShip"></h:outputLabel>
<h:selectOneMenu styleClass="selectOneMenu" 
    validator="#{bakedBean.validateContainerGoesOnShip}"
    value="#{bakedBean.container.containerGoesOnShip}"
    disabled="true"
    onchange="toggleElements()"
    id="inputContainerGoesOnShip">
<f:selectItems value="#{selectItemsFactory.yesNoEmptySelectItems}" />
</h:selectOneMenu>
<h:message id="messageContainerGoesOnShip" for="inputContainerGoesOnShip" styleClass="message"></h:message>

Is there a way to make jsf to run validator method on disabled field?
I need to check if some other field is entered based on this disabled field value ...

mismas
  • 1,236
  • 5
  • 27
  • 55
  • Duplicate: http://stackoverflow.com/questions/17945126/why-does-required-true-not-fail-validation-when-disabled-true-is-specified and http://stackoverflow.com/questions/32390081/force-jsf-to-process-validate-and-update-model-readonly-input-components-anyway – Kukeltje Aug 26 '16 at 09:18
  • Suggested links didn't help me. When I use readonly instead disabled attribute user can change selection menu ... What I need is to run validator on select menu (which should be disabled) and if it's let's says yes, then some other field should be mandatory ... – mismas Aug 26 '16 at 10:04
  • Could please anybody help? – mismas Aug 26 '16 at 11:39

0 Answers0