简体   繁体   中英

Passing a parameter to a method call in task flow ADF/EJB

Imagine the following situation. I have a bounded task flow and some functions and views:

  1. A method call which represents a function from the session bean which takes a parameter, makes some operations and returns a result. I put this parameter in the page flow scope.

  2. A view which displays the result from the function as an input text field, that can be edited - represented by a jsff page. <af:inputText value="#{bindings.name.inputValue}" ... />

  3. I have a second method call, representing again a function from the session bean. This function takes the value from the input text field and makes some operations.

The question is: How to pass the parameter from the text field in step 2 to the method call in step 3

Thank you!

What you should do is simply adding a setActionListener to the button in your page that is calling the method and in the setActionListener from:"#{bindings.name.inputValue}" to:"#{pageFlowScope.necessaryParameter}"

Be sure to add the #{pageFlowScope.necessaryParameter} to the list of the parameters in your task flow by clicking on Overview>Parameters>Input Parameters

After doing this you should only add the #{pageFlowScope.necessaryParameter} to your method call. Be sure that the input is autoSubmit="true"

If any problem faced don't hesitate to tell me. Hope this was helpful and have a good day

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM