0
我在富人脸树组件(富:树)中有上下文菜单。在我的树中,我列出了文件夹和子文件夹。通过使用上下文菜单,我可以编辑文件夹和子文件夹的数据。有编辑文件夹和子文件夹的单独方法。如何在cotnextmenu单击操作中调用此方法?rihcfaces树中的上下文菜单
我在富人脸树组件(富:树)中有上下文菜单。在我的树中,我列出了文件夹和子文件夹。通过使用上下文菜单,我可以编辑文件夹和子文件夹的数据。有编辑文件夹和子文件夹的单独方法。如何在cotnextmenu单击操作中调用此方法?rihcfaces树中的上下文菜单
对于您的两个编辑文件夹和子文件夹操作,您都可以拥有2个不同的<a4j:jsFunction>
,并在contextmenu的javascript中调用它们的onclick条件。
<rich:menuItem value="Your Context Menu Item" onclick="menuFunction();"></rich:menuItem>
<a4j:jsFunction name="editFolder" action="#{yourFolder.Edit}"/>
<a4j:jsFunction name="editSubFolder" action="#{yourSubFolder.Edit}"/>
和脚本功能
function menuFunction(){
if(subFolderNodeValue){ //Here subFolderNodeValue is the value of node, you can set it using nodeSelectionListner
editSubFolder();
}else{
editFolder();
}
}