Example code extracted from https://code.google.com/p/primefaces/source/checkout