0

我已经制作了一个 adf 树,但我无法为每个子节点添加链接。

4

3 回答 3

1

您没有提到您是否在 WebCenter Portal 应用程序中。但是,如果您在 Portal Application 中,您可以借助 NavigationContext 进行导航,您可以在文档中找到更多信息和示例。您也可以使用来自支持 bean 的 NavigationContext。您可以定义您的 commandLink 的 actionListener 并通过该方法您可以从后端以及从 jspx 页面导航到各个页面。

如果您不在 Portal 应用程序中,在 Fusion Web 应用程序中,您应该通过 adfc-config.xml 的控制流案例来定义您的导航。不要使用 FacesConfig 进行导航。阅读本文档以了解导航系统的工作原理。

由于您处于树模型中,并且如果您需要参数,那么您可以将一些值设置为会话:

<af:tree value="#{ConnectorTest.model}" var="node" > 
     <af:commandLink text="#{node.text}" action="#{node.action}">
          <af:setPropertyListener from="#{node.value}" to="#{sessionScope.value}" type="action"/>
     </af:commandLink>
</af:tree>

此处操作将在 adfc-config 中定义。如果您不需要传递参数,则忽略 af:setPropertyListener 但您应该在配置文件中定义操作。

希望这会有所帮助。


编辑:

假设您有两个页面:Page1.jspx 和 Page2.jspx。现在您需要按以下方式在 adfc-config.xml 中定义操作(特别是 from-action):

<?xml version="1.0" encoding="ISO-8859-1" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
  <view id="p1">
    <page>/path-to-the/Page1.jspx</page>
  </view>
  <view id="p2">
    <page>/path-to-the/Page2.jspx</page>
  </view>

  <control-flow-rule>
    <from-activity-id>p1</from-activity-id>
    <control-flow-case>
      <from-outcome>goToP2</from-outcome>
      <to-activity-id>p2</to-activity-id>
    </control-flow-case>
  </control-flow-rule>
</adfc-config>

现在,如果您有一个 commandLink: <af:commandLink id="link" action="goToP2" />将导航到 Page2.jspx。action 属性也接受 el 表达式。

于 2012-04-26T17:50:45.033 回答
0

<af:switcher>如果要为不同的子节点显示不同的操作,可以使用标签

于 2012-04-26T14:36:00.863 回答
0

你的意思是在子节点上添加超链接吗?

<af:tree var="node" value="#{myBean.myTree.root}" id="t1" focusListener="#{myBean.eventMethod}">
<af:commandLink text="#{node.firstname}" />
</af:tree>

当您单击节点时,它会触发焦点事件并调用接受 FocusEvent obj 作为参数的方法 eventMethod,在此方法中您设置导航规则等......

试试看

于 2012-04-26T07:33:16.547 回答