in
jsf I can write something like this:
<af:commandLink text="Save"
actionListener="#{pageFlowScope.myBean.saveMethod}"
id="save">
<af:setActionListener from="#{student.id}" to="#{pageFlowScope.myBean.id}"/>
<af:setActionListener from="#{student.name}" to="#{pageFlowScope.myBean.name}"/>
</af:commandLink>
I need to generate this kind of code programmitically. it generate multiple save links.
Now I can write programmitically like:
RichCommandLink saveLink = new RichCommandLink();
MethodExpression mbForSave =
facesContext.getApplication().getExpressionFactory().createMethodExpression(facesContext.getELContext(),
"#{pageFlowScope.myBean.saveMethod}",
null,
new Class[] { ActionEvent.class });
saveLink.addActionListener(new MethodExpressionActionListener(mbForSave));
but how to set from and to parameters programmitically?