0

I have a Custom Validation on one input text which gets enabled when a unit is selected in selectManyListbox.

I need to check if the inputtextarea is null/empty. If so, throw an error message.

<p:inputText id="other1"  size="80" maxlength="80" disabled="#{bean1.Conversation1.m_otherDisabled}"                                
         value="#{bean1.other1}"                                    
         validator="#{bean1.validateOther1}"                                    
         data-label = "#{otherPageMsg.other1}" data-section = "#{otherPageMsg.sectionTitle2Lbl}" data-order = "2" />

This above code worked perfectly until the below code was introduced in the web.xml.

<context-param>
<param-ame>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>

Now, it is not even hitting bean if left empty and submitted. It triggers validation only if any data is entered.

How to invoke the custom validator to hit the bean method and do validation? I tried requred="true" in this case. But it is applying to sleectmanylistbox too which I dont need. My only way is to make this custom validation work.

Any ideas?

Indu New
  • 1
  • 1
  • 3
  • Using `required="true"` is the answer. *"But it is applying to sleectmanylistbox too which I dont need"*, this is not the default behavior. Just fix that part so you can use `required="true"`. – BalusC May 02 '16 at 20:21
  • Thank you! I have SelectManylistbox and this inputtext in a single Panel. I am thinking if that is what causing trouble. Will check. Thanks! – Indu New May 02 '16 at 20:35

0 Answers0