页定义文件:pagedef

来源:互联网 发布:linux指令cp 编辑:程序博客网 时间:2024/05/08 03:03

        page define 文件为应用程序中每一页面定义了绑定容器(binding container),运行时被用于创建binding container对象,binding container对象 为页面访问提供了访问bindings,因此每个页面都有一个page define文件:

包括四个子成员:

  1. <parameters>:定义了page-level的参数可以通过EL表达式访问,保存页面请求的局部信息。(These
    parameters store information local to the web page request and may be accessed in
    the binding expressions)
  2. <executables>:定义了在ADF生命周期prepareModel 阶段调用的method或accessor.
  3. <bindings>: refers to an entry in <executables> to get to the collection from which
    bindings extract/submit attribute level data.一个<executables> 入口


bindings成员:
在bindings成员定义的binding 对象,有三种:
Value:
MethodAction:
Action:


value:引用iterator binding对象,在UI组件显示数据。页面上每一个UI组件,若要显示数据,都要绑定到一个value binding 对象。其中包括:
table,list,AttributeValues,tree.


MethodAction:封装了数据控件(data control) 中自定义方法调用的细节,包括方法的参数。
1、command 组件通过MethodAction绑定到data control的方法。
2、MethodIterator 被绑定到MethodAction对象。


Action:command 组件被绑定到biulding-in Operator包括:

1、 data control operations(提交、回滚), 2、colletion-level operations(Next,Previous,Create,Save)


总之:在bindings成员定义的binding 对象被当作control bindings来引用,页面中的每一个databound control都被绑定到这些对象,这些对象依次又被绑定到executables 成员。

executables 成员:

字面意思是可执行的对象,包括:
MethodIterator:
AccessorIterator:
VariableIterator:
InvoteAction:


MethodIterator:绑定到data control中自定义方法返回值的Iterator,MethodIterator必须关联一个binding 成员中定义MethodAction,MethodAction定义的data control 中调用方法的明细。


AccessorIterator:绑定到data control中accessor 返回的明细对象。通过MasterBinding属性与一个MethodIterator对象关联。
VariableIterator:exposes binding container 中的所有变量给 the other bindings.
Page variable是binding container局部的(Local),只有binding container存在是Page variable才存在,当data control 中的方法和操作的参数需要在页面上获取时,JDeveloper 自动创建一个定义一个Variable,Attribute bindings 会引用这个变量。


InvokeAction:调用一个在MethodAction和Action中定义的method或operator。


       Iterator被绑定到一个底层的 ADF RowSetIterator 对象,维护当前对象及range,rangeSize.页面上的每一个集合都有一个相应的iterator binding.但variableIterator只有一个。所有的value binding必须引用Iterator binding,以便在运行时填充值。


运行时executables成员被按在页面定义的顺序刷新。Refresh:指定在ADF的生命周期。RefreshCondition:布尔表达式,指定是否刷新。

Refresh属性的值:

Determines when and whether the executable should be invoked. Set one of the following properties as required:

  • always - causes the executable to be invoked each time the binding container is prepared. This will occur when the page is displayed and when the user submits changes, or when the application posts back to the page.
  • deferred(延期的, 缓召的) - refresh occurs when another binding requires/refers to this executable.Since refreshing an executable may be a performance concern, you can set the refresh to only occur if it's used in a binding that is being rendered.
  • ifNeeded  - (default) whenever the framework needs to refresh the executable because it has not been refreshed to this point. For example, when you have an accessor hierarchy such that a detail is listed first in the page definition, the master could be refreshed twice (once for the detail and again for the master!ˉs iterator). Using ifNeeded gives the mean to avoid duplicate refreshes. This is the default behavior for executables.
  • never - When the application itself will call refresh on the executable during one of the controller phases and does not want the framework to refresh it at all.
  • prepareModel - causes the executable to be invoked each time the page's binding container is prepared.
  • prepareModelIfNeeded - causes the executable to be invoked during the prepareModel phase if this executable has not been refreshed to this point. See also ifNeeded above.
  • renderModel - causes the executable to be invoked each time the page is rendered.
  • rennderModelIfNeeded - causes the executable to be invoked during the page!ˉs renderModel phase on the condition that it is needed. See also ifNeeded above.