2012-04-26 48 views

回答

0

你是否指在子节点上添加超链接?

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

当u点击接受FocusEvent OBJ作为参数,在此方法u盘导航规则等等等节点它火焦点事件和呼叫方法eventMethod .....

尝试

+0

是的,向树中的每个子节点添加超链接,并且不同的子节点指向不同的html/jsp页面。 – SumitJ 2012-04-26 07:41:26

+0

这是我的树: 连接器树是我的java类。 – SumitJ 2012-04-26 12:12:30

0

对于不同的子节点,您可以使用<af:switcher>标记(如果要显示不同的操作)

1

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

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

既然你是一个树模型,如果你需要参数,那么你可以将某些值设置为会话:

<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中定义的动作(特别是从行动)的方式如下:

<?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表达式。

+0

它没有工作。我必须检索每个节点的值,然后根据单击的节点设置一个操作。即如果特定的节点被点击,那么相应的jsp应该打开。这是我的树 - http://yonaweb.be/creating_your_own_treemodel_adf_11g_0 – SumitJ 2012-04-30 07:57:56

+0

@SumitJha你在哪里定义了你的动作? – 2012-04-30 08:25:26

+0

我定义的唯一操作是在命令链接中 SumitJ 2012-04-30 09:20:31

相关问题