简体   繁体   English

将参数传递给任务流ADF / EJB中的方法调用

[英]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. 一个方法调用,它代表来自会话Bean的函数,该函数接受参数,进行一些操作并返回结果。 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. 一个视图,该视图将功能的结果显示为输入文本字段,可以编辑-由jsff页面表示。 <af:inputText value="#{bindings.name.inputValue}" ... />

  3. I have a second method call, representing again a function from the session bean. 我有第二个方法调用,再次表示会话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 问题是:如何将参数从步骤2中的文本字段传递到步骤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}" 您应该做的只是将setActionListener添加到正在调用该方法的页面中的按钮以及setActionListener中,从:“#{bindings.name.inputValue}”到:“#{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 通过单击“概述”>“参数”>“输入参数”,确保将#{pageFlowScope.necessaryParameter}添加到任务流中的参数列表中

After doing this you should only add the #{pageFlowScope.necessaryParameter} to your method call. 完成此操作后,您只应将#{pageFlowScope.necessaryParameter}添加到您的方法调用中。 Be sure that the input is autoSubmit="true" 确保输入为autoSubmit =“ true”

If any problem faced don't hesitate to tell me. 如果遇到任何问题,请随时告诉我。 Hope this was helpful and have a good day 希望这对您有所帮助,并祝您有美好的一天

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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