0

I have a PrimeFaces dataTable, where each row contains two PrimeFaces calendar popup elements (FromDate, ToDate). I want to make sure two date ranges are not equal. I tried using Omnifaces validateMultiple but couldn't get it to work. Rows can be dynamically added and removed from the table by the user, so I don't know how many there are.

How do I address those elements in Omnifaces? As far as I see, only IDs can be used, no classes. Also, Omnifaces doesn't know something like jQuery selectors/PFS.

What would be a better solution to this? I'd prefer a solution using plain JSF, Omnifaces or Primefaces.

//edit Feb 12, '16: I found this tutorial on how to validate multiple components using PrimeFaces. The tutorial works, but it doesn't solve my issue. The thing is, I cannot get the values of all the date pickers to check. I can only search them by ID, which is not sufficient, as they can be added and removed by the user. I also tried getting the surrounding DataTable and friggle the individual date pickers out. This also does not work since the UINamingContainer I get does not contain the value of the date picker.

sinned
  • 503
  • 1
  • 7
  • 25

0 Answers0