0

I have added the validateMultiple tag from last Omnifaces 1.7 release, and for some reason it causes my application to refresh the view continously.

I would like to validate several time fields with my custom validator.

This is the code snippet I'm using:

   <o:validateMultiple id="addTODValidator" 
                       components="startTimePicker endTimePicker" 
                       validator="#{TODIntervalValidator.validateValues}" 
                       message="time interval"
                       />

    <pe:timePicker id="startTimePicker"
                   value="#{TimeOfDayBranchAddNodeController.startTOD}" mode="spinner"  
                   showOn="button" label="Spinner time picker with button"
                   disabled="#{TimeOfDayBranchAddNodeController.otherSelected}"
                   widgetVar="startTimeWidget"/>                      

    <h:outputText value="EndTime" />             
    <pe:timePicker id="endTimePicker"
                   value="#{TimeOfDayBranchAddNodeController.endTOD}" mode="spinner" 
                   showOn="button" label="Spinner time picker with button"
                   disabled="#{TimeOfDayBranchAddNodeController.otherSelected}"
                   widgetVar="endTimeWidget"
                   />   

And the managed bean with the custom logic:

@ManagedBean(name = "TODIntervalValidator")
@RequestScoped
public class TODValidator implements MultiFieldValidator{
    @ManagedProperty(value = "#{addNodeDialogController}")
    private AddNodeDialogController addNodeDialogController;    

    public boolean validateValues(FacesContext context, List<UIInput> components, List<Object> values) {

Anyone with experience on this new feature? BalusC any ideas?

Thanks in advance

Jaime Casero
  • 371
  • 2
  • 6
  • Please describe "refresh the view continously" in developer's terms instead of enduser's terms. Also, do you see chance to reproduce the problem with just standard JSF components such as `` and create a SSCCE around it? Just to exclude PrimeFaces and/or Extensions from playing a role in the problem. – BalusC Jan 20 '14 at 15:02
  • Funny you mention the usage of standard components, I was suspicious about the combination with TimePicker (PE extensions tag). I will try to create that example with just inputText. – Jaime Casero Jan 20 '14 at 16:07

0 Answers0