PPR的使用学习

来源:互联网 发布:仿站长工具网站源码 编辑:程序博客网 时间:2024/04/27 16:38

Using the simplest form of cross-component rendering, one component, referred to as the target component, is rerendered when any event occurs on another component, referred to as the trigger component.

 

Trigger components must inform the framework that a PPR request has occurred. On command components, this is achieved by setting the partialSubmit attribute to true. Doing this causes the command component to fire a partial page request each time it is clicked.

 

For example, say a page includes an inputText component, a commandButton component, and an outputText component. When the user enters a value for the inputText component, and then clicks the commandButton component, the input value is reflected in the outputText component. You would set the partialSubmit attribute to true on the commandButton component.

 

However, components other than command components can trigger PPR. ADF Faces input and select components have the ability to trigger partial page requests automatically whenever their values change. To make use of this functionality, use the autoSubmit attribute of the input or select component so that as soon as a value is entered, a submit occurs, which in turn causes a valueChangeEvent event to occur. It is this event that notifies the framework to execute a PPR, as long as a target component is set. In the previous example, you could delete the commandButton component and instead set the inputText component's autoSubmit attribute to true. Each time the value changes, a PPR request will be fired.

 

如果在POPUP里的BUTTON不用partialSubmit的话,POPUP里的inputtext的validator无法显示出error message,且inputext 的初始值不会去更新

 

partialTrigger是触发器,比如把buttion的id设为panalbox的partialTrigger值,点button会触发panalbox的值改变