To call a managed bean method without exposing the managed bean as data control, we can do following;
For a method like this:
public class MyBean {
public MyBean() {
super();
}
public void myMethod(String arg1) {
System.out.println(arg1);
}
}
Add following method invocation code in page definition file:
<methodAction id="CallMyMethodOnMyBean"
InstanceName="${MyBean}"
MethodName="myMethod" DataControl="AppModuleDataControl">
<NamedData NDName="arg1" NDType="java.lang.String" NDValue="Foo"/>
</methodAction>
Sample:: http://java.net/projects/smuenchadf/sources/samples/content/MethodActionThatCallsManagedBeanWithoutDataControlInvolved.zip
For a method like this:
public class MyBean {
public MyBean() {
super();
}
public void myMethod(String arg1) {
System.out.println(arg1);
}
}
Add following method invocation code in page definition file:
<methodAction id="CallMyMethodOnMyBean"
InstanceName="${MyBean}"
MethodName="myMethod" DataControl="AppModuleDataControl">
<NamedData NDName="arg1" NDType="java.lang.String" NDValue="Foo"/>
</methodAction>
Sample:: http://java.net/projects/smuenchadf/sources/samples/content/MethodActionThatCallsManagedBeanWithoutDataControlInvolved.zip