Hello guys,
Please let me know a solution for the following issue.
I have a tree by nesting table column in a similar fashion.
==RootElement1
-
.childElement1
-
.childElement2
-
.childElement3
==RootElement2
-
.childElement1
-
.childElement2
-
.childElement3
The table column has a check box as the table cell editor. In this case, when i check the root element, all the child elements pertaining to the selected rootelement will be selected and vice versa. now when i uncheck the child element, the root element will also get unchecked. I am using the code as below to do the same.
<DO modify view> if(firstTime) { IWDTreeByNestingTableColumn tableColumn = (IWDTreeByNestingTableColumn)view.getElement("MasterColumn"); tableColumn.mappingOfOnLoadChildren().addSourceMapping("path","element"); IWDCheckBox checkBox = (IWDCheckBox)view.getElement("CheckBox"); checkBox.mappingOfOnToggle().addSourceMapping("nodeElement","nodeElement"); }
<Action ontoggle of the checkbox> public void onActionToggleBox(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.arteriatech.demo.wdp.IPrivateDemoCompView.IVnTreeNodeElement nodeElement ) { //@@begin onActionToggleBox(ServerEvent) if(nodeElement.getVaCheck() && !nodeElement.getVaIsLeaf()) { for(int i=0;i<nodeElement.nodeRecTree().size();i++) { nodeElement.getRecTreeElementAt(i).setVaCheck(true); } } else if(!nodeElement.getVaCheck()) { if(!nodeElement.getVaIsLeaf()) { for(int i=0;i<nodeElement.nodeRecTree().size();i++) { nodeElement.getRecTreeElementAt(i).setVaCheck(false); } } else { int curr_sel = nodeElement.node().getParentElement().node().getLeadSelection(); wdComponentAPI.getMessageManager().reportSuccess("1-->"+nodeElement.node().getLeadSelection()); wdComponentAPI.getMessageManager().reportSuccess("2-->"+curr_sel); wdContext.nodeVnTreeNode().getVnTreeNodeElementAt(curr_sel).setVaCheck(false); } }
Please note,
This scenario works fine when i have the table property selection mode = none, compatibility mode = auto. But when i change the compatibility mode to nw04plus, the first root element gets unchecked when i uncheck the child element belonging to other root elements i.e., the lead selection of the root element always remains 0.
Hence let me know a solution for the same.
Regards,
Karthikeyan R