The following code snippets is to execute search button in ADF Query search button programmatically without interact from User
public void onQueryListener(QueryEvent queryEvent) {
// Add event code here...
try{
FacesContext fcsCtx = FacesContext.getCurrentInstance();
ELContext elCtx = fcsCtx.getELContext();
ExpressionFactory expFactory = fcsCtx.getApplication().getExpressionFactory();
MethodExpression mthdExp =
expFactory.createMethodExpression(elCtx, "#{bindings.EmpVOCriteriaQuery.processQuery}", null,
new Class[] { queryEvent.getClass() });
mthdExp.invoke(elCtx, new Object[] { queryEvent });
}
catch(Exception e){
e.printStackTrace();
}
}
Thanks
public void onQueryListener(QueryEvent queryEvent) {
// Add event code here...
try{
FacesContext fcsCtx = FacesContext.getCurrentInstance();
ELContext elCtx = fcsCtx.getELContext();
ExpressionFactory expFactory = fcsCtx.getApplication().getExpressionFactory();
MethodExpression mthdExp =
expFactory.createMethodExpression(elCtx, "#{bindings.EmpVOCriteriaQuery.processQuery}", null,
new Class[] { queryEvent.getClass() });
mthdExp.invoke(elCtx, new Object[] { queryEvent });
}
catch(Exception e){
e.printStackTrace();
}
}
Thanks
No comments:
Post a Comment