I'm working on a JSF project using PrimeFaces and I have some custom components to facilitate the work. One of them is a search component that is formed for a input text with a button that opens a dialog. In the dialog I have a data table that lists some data. When the user chooses some record, the input text is updated with this record and the the managedbean is updated too. To avoid curious users, that could change the value of the input text, I set this field to readonly, but the field is required. The problem arises when the user does not select a value in the datatable and the input field remains empty. In this case, JSF doesn't validate readonly fields, and my validation rules are broken when the user doesn't provide no value.
Is there a way to validate readonly fields when I submit the form?
Thanks.