0

i followed this approach JSF doesn't support cross-field validation, is there a workaround? to have a multicomponent validator. In my case six input fields inside each row in a datatable(primefaces). Validation process seems to work right but strange thing is, when i only have one row, the form is submitted, validated, backing bean populated and so on. When i have more than one row,, the form is submitted, validated, but save method on backing is not called. Debug in browser prints in http response:

class java.lang.NumberFormatException>>

And using a phase listener to log component life cycle i see this:

2014-09-30/23:23:25.579/BST DEBUG LifeCycleListener:24:[http-apr-8080-exec-4] - START PHASE RESTORE_VIEW 1
2014-09-30/23:23:25.581/BST DEBUG LifeCycleListener:24:[http-apr-8080-exec-4] - START PHASE RESTORE_VIEW 1
2014-09-30/23:23:25.697/BST DEBUG LifeCycleListener:19:[http-apr-8080-exec-4] - END PHASE RESTORE_VIEW 1
2014-09-30/23:23:25.701/BST DEBUG LifeCycleListener:19:[http-apr-8080-exec-4] - END PHASE RESTORE_VIEW 1
2014-09-30/23:23:25.702/BST DEBUG LifeCycleListener:24:[http-apr-8080-exec-4] - START PHASE RENDER_RESPONSE 6
2014-09-30/23:23:25.702/BST DEBUG LifeCycleListener:24:[http-apr-8080-exec-4] - START PHASE RENDER_RESPONSE 6
2014-09-30/23:23:26.270/BST DEBUG LifeCycleListener:19:[http-apr-8080-exec-4] - END PHASE RENDER_RESPONSE 6
2014-09-30/23:23:26.270/BST DEBUG LifeCycleListener:19:[http-apr-8080-exec-4] - END PHASE RENDER_RESPONSE 6

I'm not using any converter, just my custom validator. What am i doing wrong? Thanks

Community
  • 1
  • 1
Arthur Portas
  • 129
  • 1
  • 2
  • 13
  • @BalusC Thanks for helping! Here is the .xhtml - http://pastebin.com/9YqYGj3g The backing bean - http://pastebin.com/TsvqHSjn and the validator - http://pastebin.com/0H1CrqMR Backing bean is in Session scope and project has on web.xml `code` State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2 javax.faces.STATE_SAVING_METHOD client How can i provide here the stack trace? Do i need a global exception handler and log the stack track there? – Arthur Portas Oct 01 '14 at 09:30
  • @BalusC please ignore this question, exception thrown is inside validator. I'll simplify this code piece. Thanks anyway! – Arthur Portas Oct 01 '14 at 12:10

0 Answers0