ADF filter table based on tree selection

只谈情不闲聊 提交于 2019-12-12 04:36:07

问题


How to filter Oracle ADF table contents based on tree selection?

Bindings:

So the table always renders as if the first item would be selected in the tree, but when I click on some other VariablePoint, the table does not change:

UPDATE

Based on the answers, I was able to configure the following, and it solved the problem:

I made an iterator for every tree level rule and used them as Target Data Source for each tree/tree level rule.


回答1:


ADF trees may look somewhat misleading, but they don't actually reflect the data controls (iterators) that your've created in your application module. Trees work on view links accessors. That's why when you select a tree node, iterators don't get any changes.

If you want to see your accessors in your Model project open a view link between any two adjacent view objects used in your hierarchy. In Relationship - Accessors - Destination you will see Accessor Name parameter. Its value would be the name of lower tree level. The same name you will see in your pageDef tree binding in Tree Level Rules section for appropriate level.

So even if you delete all iterators but OrgView1Iterator from your application module data control, your tree would still function (not speaking about table to the right at the moment).


Now to make your case work.

  1. In your application module data control you will only need this hierarchy:
    • OrgView1
    • VariablePointViewOrgZoneVariable
      • VariablePointViewOrgZoneVariableVariablePoint

OrgView1 and VariablePointViewOrgZoneVariable are at root level. VariablePointViewOrgZoneVariableVariablePoint is a child of VariablePointViewOrgZoneVariable. All current children of OrgView1 should be removed from data control.

  1. In your page binding in Executables section click green plus and add VariablePointViewOrgZoneVariable iterator (say, VariablePointViewOrgZoneVariable1Iterator).

In your Executables there should be 3 iterators: OrgView1Iterator, VariableDataView1Iterator and VariablePointViewOrgZoneVariable1Iterator.

  1. The key part of filtration is Target Data Source attribute. You can find it in your tree binding. In your page binding in Bindings section double click on OrgView1. In tree level rules select VariablePointViewOrgZoneVariable tree and disclose Target Data Source at the bottom. Click EL Picker, select VariablePointViewOrgZoneVariable1Iterator and OK.

The result should be ${bindings.VariablePointViewOrgZoneVariable1Iterator}.

  1. On your page set table's partialTrigger attribute to point to the tree.

After you restart your page filtration should work.


I've made a small example showing your case. Follow instructions and you can run it on your computer or just read through readme. It also applies selection to the last tree level, which you may not need.

https://github.com/ILyaCyclone/adf-tree-to-table-filterandselect



来源:https://stackoverflow.com/questions/45495542/adf-filter-table-based-on-tree-selection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!