on 2009 Jan 28 4:53 PM
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
Hi Karthikeyan,
When you check or uncheck a checkbox the leadselection will not move to the row where you checked. It will remain where it was earlier. In your case the leadselection was always at the first row of the Hierarchical Table. So instead of using the leadselection you can directly get the parent element and set the checkbox.
IPrivateVnTreeNodeElement parentTreeElement = (IPrivateVnTreeNodeElement) nodeElement.node().getParentElement();
parentTreeElement.setVaCheck(false);
Hope this helps.
Regards,
Sanyev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
72 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.