-
1. Re: implement <f:setPropertyActionListener> programatically
ramram888 Jul 20, 2011 2:17 AM (in response to ramram888)Any update on the above issue?
-
2. Re: implement <f:setPropertyActionListener> programatically
yaseralhs Jul 20, 2011 2:29 AM (in response to ramram888)hi
Can see this :
http://www.mkyong.com/jsf2/jsf-2-setpropertyactionlistener-example/
Full Example
Regards,
Yaser
-
3. Re: implement <f:setPropertyActionListener> programatically
ramram888 Jul 20, 2011 6:58 AM (in response to yaseralhs)Hi Yaser,
Thanks for your reply.
I am building a dynamic HtmlDataTable on server side and i need to add <f:setPropertyActionListener> programatically to some componenets.
I want to know how can I add <f:setPropertyActionListener>. Does HtmlActionParameter make the job?
Regards,
Ram
-
4. Re: implement <f:setPropertyActionListener> programatically
bleathem Jul 20, 2011 12:09 PM (in response to ramram888)Server side events/observers are really easy using CDI. See Adam Bien's great write-up on CDI events:
http://www.adam-bien.com/roller/abien/entry/java_ee_6_observer_with
-
5. Re: implement <f:setPropertyActionListener> programatically
ramram888 Jul 21, 2011 3:24 AM (in response to bleathem)Hi All,
Below is the solution:
ValueExpression v = facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "# {object}",ObjectClass.class);
ValueExpression t = facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#
{BackBean.property}",ObjectClass.class);javax.faces.event.
ActionListener handler = new SetPropertyActionListenerImpl(t, v);
HtmlAjaxSupport ajaxSupport = new HtmlAjaxSupport();
ajaxSupport.addActionListener(handler);
Regards,
Ram Ram