一、ADF文档对PPR的说明
使用环境:Jdeveloper10.3.2,英文说明部分参见《Oracle Application Development Framework Developer's Guide》11.4
1、autoSubmit: When the autoSubmit attribute of an input component (such as
inputText and selectOneChoice) or a table select component (such as
tableSelectOne) is set to true, and an appropriate action takes place (such as a
value change), the component automatically submits the form it is enclosed in. For
PPR, you might use this in conjunction with a listener attribute bound to a method
that performs some logic when an event based on the submit is launched.
当输入组件(如 selectOneChoice 和 inputText)或表选择组件(如tableSelectOne)的autoSubmit属性 被设置为true, 一个适当的动作发生(如值改变事件),组件自动提交被包围的表单。对于PPR,您可以使用监听器属性绑定到一个方法
,用以在提交时执行业务处理逻辑。
2、partialSubmit: When the partialSubmit attribute of a command component
is set to true, the page partially submits when the button or link is clicked. You
might use this in conjunction with an actionListener method that performs
some logic when the button or link is clicked.
局部提交: 当command组件的partialSubmit属性被设置为true,当按钮或链接点击时,页面将部分提交。你可以使用这个方法通过<按钮>或<链接>来执行一个actionListener内的业务逻辑。
3、partialTriggers: All rendered components support the partialTriggers
attribute. The value of this attribute is one or more IDs of other trigger
components. When those trigger components are updated (for example through
an automatic submit or a partial submit), the target component is also updated.
partialTriggers: 所有组件支持partialTriggers呈现属性。这个属性的值是一个或多个IDs其他的触发器组件。当这些触发组件更新(例如通过一个自动提交或部分提交),目标组件也会更新。(用途:用在级联刷新、新窗口选择值后的及时刷新功能上面。)
二、典型应用一
2.1 弹窗选择对象后,更新选中的对象到文本框显示。
1. 关联刷新的组件,可为任意组件。
<af:inputText value="#{bindings.ObKeeperName.inputValue}"
required="#{bindings.ObKeeperName.mandatory}"
columns="34"
binding="#{ObBean.obKeeperName}"
disabled="true"
partialTriggers="ObKeeperName"/>
2. Command按钮,绑定执行动作,设置 partialSubmit="true" 后,点此按钮后,以局部刷新方式提交请求(执行后台Action),同时对该动作执行将影响到已注册到此command的partialTriggers。使得此按钮完成后,已注册的组件同时执行刷新动作。
<af:commandLink id="ObKeeperName"
returnListener="#{ObUIListenerMethod.keeperLovReturnLisener}"
actionListener="#{ObUIListenerMethod.keeperLovActionLister}"
action="dialog:dynamicLOV" useWindow="true"
windowHeight="600" windowWidth="600"
immediate="true" partialSubmit="true">
</af:commandLink>
三、使用代码刷新
partialTrigger属性可以刷新控件,通过以下代码也可以刷新绑定的控件
AdfFacesContext.getCurrentInstance().addPartialTarget(“绑定控件的instace名或者是UIComponent对象”)