2014-08-28 29 views
0

我有查看链接,我已经将它拖到.jsff页面中的ADF树表中。子节点中的树表命令链接

 <af:treeTable value="#{bindings.SisaiEndPointView1.treeModel}" var="node" 
       rowSelection="single" id="TT1" contentDelivery="immediate" 
       columnStretching="last" partialTriggers=":::commandButton1" 
       editingMode="clickToEdit" 
       contextMenuSelect="true"> 
    <f:facet name="nodeStamp"> 
     <af:column id="column1" headerText="Ministry" sortable="true" 
       width="200%"> 
     <af:outputText value="#{node.Ministry}" id="outputText1"/>    
     </af:column> 

    </f:facet> 

    <af:column id="column5" headerText="#Errors" width="100%"> 

<af:commandLink text="#{node.ErrorMsgCount}" id="cl2" immediate="true" partialSubmit="true" action="#{pageFlowScope.EndPointBean.testInput}">   

    <af:setActionListener from="test #{node.ErrorMsgCount}" 
           to="#{pageFlowScope.Min}"/>    
</af:commandLink> 


</af:column> 

public String testInput() { 
    String str = (String)ADFContext.getCurrent().getPageFlowScope().get("Min"); 
    System.out.println(str); 
    return null; 
} 

,我没有得到我的行动方法STR正在印刷任何价值。 它只提供硬编码值“测试”,但没有得到#{node.ErroMsgCount}。

回答

0

试试这个。

<af:setPropertyListener from="#{node.ErrorMsgCount}" to="#{pageFlowScope.Min}" type="action"/> 

希望它会工作...

0

对不起已故的答复我试图财产听众也还没有工作。

之后,我发现上述操作完全有效的解决方案。这是VO不能更新的问题。

0

我认为你要找的是一个actionListener。所以,你的代码如下:

<af:treeTable value="#{bindings.SisaiEndPointView1.treeModel}" var="node" 
       rowSelection="single" id="TT1" contentDelivery="immediate" 
       columnStretching="last" partialTriggers=":::commandButton1" 
       editingMode="clickToEdit" 
       contextMenuSelect="true"> 
    <f:facet name="nodeStamp"> 
     <af:column id="column1" headerText="Ministry" sortable="true" 
       width="200%"> 
     <af:outputText value="#{node.Ministry}" id="outputText1"/>    
     </af:column> 

    </f:facet> 

    <af:column id="column5" headerText="#Errors" width="100%"> 

<af:commandLink text="#{node.ErrorMsgCount}" id="cl2" immediate="true" partialSubmit="true" actionListener="#{pageFlowScope.EndPointBean.testInput}">   

    <af:setActionListener from="test #{node.ErrorMsgCount}" 
           to="#{pageFlowScope.Min}"/>    
</af:commandLink> 


</af:column> 

public void testInput(ActionEvent ae) { 
    String str = (String)ADFContext.getCurrent().getPageFlowScope().get("Min"); 
    System.out.println(str); 
    return null; 
} 

一些事情。

  1. PageFlowScope适用于整个任务流程。我不确定您的使用情况,但使用可能的最低范围。
  2. setPropertyListener与type =“action”和setActionListener非常相似,所以它们的行为大体相同。
  3. 您正在使用的这个bean除非需要在任务流中的页面之间保存值,否则将bean的范围从pageFlowScope中降低。
0

尝试删除inmediate =“真”

<af:commandLink text="#{node.ErrorMsgCount}" id="cl2" partialSubmit="true" action="#{pageFlowScope.EndPointBean.testInput}"> 

当你inmediate设置为true,此跳过更新模型阶段,您看不到的变化。

Marcos