This content has been marked as final.
Show 3 replies
-
1. Re: Adding setRequired() programmatically to expression
radhesh Jul 24, 2009 11:12 AM (in response to oneworld95)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);
-
2. Re: Adding setRequired() programmatically to expression
oneworld95 Jul 24, 2009 11:40 AM (in response to oneworld95)Wow!! That's exactly what I needed, radhesh. Thank you so much for the code example :)
-
3. Re: Adding setRequired() programmatically to expression
oneworld95 Jul 24, 2009 3:43 PM (in response to oneworld95)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.