MYFACES-3549 Alternative solution to bugs MYFACES-3262 and MYFACES-3510 (Thanks to Jesús Pérez Alcaide (ISBAN) for provide this patch)