How to add parameter to adf form
2 answers
If you want to pass a parameter. Do it in commandButton / commandLink. Or you can pass the attribute to the form.
Parameter passing
<af:commandLink text="click here"
action="#{testbean.buttonClicked}" >
<f:param name="et1" value="etc"/>
</af:commandLink>
Accessing it In the Bean
FacesContext facesContext= FacesContext.getCurrentInstance();
Map requestMap=facesContext.getExternalContext().getRequestParameterMap();
Or
Passing an attribute
<af:form id="f1" binding="#{testbean.form}">
<f:attribute name="et1" value="etc"/>
The Bean
In action method
String value2=(String)form.getAttributes().get("et1");
Or is it best to use
af: setPropertyListener
In the command component
<af:commandLink text="click here"
action="#{testbean.buttonClicked}" >
<af:setPropertyListener type="action" from="etc" to="#{et1}"/>
</af:commandLink>
In the Bean on action method
String value3=(String)evaluateEL("#{et1}");
0
source to share