How do I add a parameter at...">

How to add parameter to adf form

I have a jsff page.

In this case, I define a <af:form id="f1"></af:form>

How do I add a parameter attribute to an action in this form?

I used a tag <f:param ... />

inside this form:

<af:form id="f1">
<f:param value="#{param.id}" name="id"/>
...
</af:form>

      

but it doesn't work.

+3


source to share


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


put a button or link or ... in your form and use:

    <af:setActionListener from="value" to="#{...Scope.yourParam}"/>

      



"..." could be SessionScope, pageFlowScope, etc.

0


source







All Articles