This content has been marked as final.
Show 1 reply
-
1. Re: Validation of multiple <rich:listShuttle> items
jakeclarkson87 Nov 30, 2011 5:25 AM (in response to jakeclarkson87)I have now resolved this issue.
In my validation I was able to get the value as follows; I needed to check that the a collection of three <rich:listShuttle> elements had at least one element selected between them, I acheived this as follows.
ArrayList selectedElements1 = (ArrayList) this.availableElementsShuttle1.getTargetValue(); ArrayList selectedElements2 = (ArrayList) this.availableElementsShuttle2.getTargetValue(); ArrayList selectedElements3 = (ArrayList) this.availableElementsShuttle3.getTargetValue(); if (selectedElements1 != null && selectedElements1.isEmpty() && selectedElements2 != null && selectedElements2.isEmpty() && selectedElements3 != null && selectedElements3.isEmpty()) { // throw ValidatorException as all the listShuttle elements are empty }
The availableElementsShuttlex Objects are UIListShuttle instances bound to <rich:listShuttle> elements in the XHTML via the binding attribute. A hidden field was used with a validator attribute which points to a method which houses the code above.