setRequired may not work.
You will have to construct an EL Expression using the String and set the expression as a value binding to the component: Something like:
FacesContext ctx = FacesContext.getCurrentInstance(); ValueExpression ve = ctx.getApplication().getExpressionFactory().createValueExpression(ctx .getELContext(),el.toString(), Boolean.class); hoursInput.setValueExpression("required", ve);
Wow!! That's exactly what I needed, radhesh. Thank you so much for the code example :)
A followup: How do I also add a ValueBinding to this same control, so that its value is bound to a property on a bean? Thanks.