hi @docvominh
I have nearly the same case and i can call ivy method by this function:
public static Object evalELExpressionAsObject(String expression, FacesContext context) {
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELContext();
ValueExpression vex = expressionFactory.createValueExpression(elContext, expression, Object.class);
Object result = (Object) vex.getValue(elContext);
return result;
}
Here is calling:
evalELExpressionAsObject("#{logic.doSomething()}", FacesContext.getCurrentInstance());
but in my experience, we only can call methods if they belong to Main Page (in your example) and can't call method of ComponentProcess component.
Because ivy have the mechanism to resolve keyword #data and #logic in correct context (see http://answers.axonivy.com/questions/2549/mechanism-to-resolve-data-and-logic-of-htmluserdialog)
So when you evaluate those twos manually, it will take the biggest context (the page).
P/S: once i can get the method of sub-component sucessfully but it lead to a lot of issue with security in ivy, so i suggest you should not do that (it look like a hack). You can introduce a managed bean for you your component and you can call methods from there.
Cheers,