FacesContext context = FacesContext.getCurrentInstance();
ELContext elContext = context .getELContext();
MethodExpression actionListenerExpression = context.getApplication().getExpressionFactory().createMethodExpression(elContext,"#{myHandler.myActionListenerMethod}",null,new Class[] {ActionEvent.class});
MethodExpressionActionListener methodExpressionActionListener = new MethodExpressionActionListener(actionListenerExpression);
Monday, March 8, 2010
ADF:- ActionListener
try
{
Class[] parameterList = { Class.forName("javax.faces.event.ActionEvent") }; MethodBinding actionListenerBinding = FacesContext.getCurrentInstance().getApplication().createMethodBinding( "#{myHandler.myListener}",parameterList); myComponent.setActionListener(actionListenerBinding );
}
catch (Exception e)
{
log.error("error setting ActionListener");
}
{
Class[] parameterList = { Class.forName("javax.faces.event.ActionEvent") }; MethodBinding actionListenerBinding = FacesContext.getCurrentInstance().getApplication().createMethodBinding( "#{myHandler.myListener}",parameterList); myComponent.setActionListener(actionListenerBinding );
}
catch (Exception e)
{
log.error("error setting ActionListener");
}
Subscribe to:
Posts (Atom)