cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with Tree Component

Former Member
0 Kudos

Hello!

As in example I've inserted in context a special recursive Child node and then assigned parent node to this node's "repeated node" property. Parent node is mapped to the following JavaBean:

public class TreeNode {

/**

*/

Integer id;

Integer parentId;

String name;

Boolean hasChildren;

public TreeNode() {

super();

// TODO Auto-generated constructor stub

}

/**

  • @return Returns the parentId.

*/

public Integer getParentId() {

return parentId;

}

/**

  • @param parentId The parentId to set.

*/

public void setParentId(Integer parentId) {

this.parentId = parentId;

}

/**

  • @return Returns the id.

*/

public Integer getId() {

return id;

}

/**

  • @param id The id to set.

*/

public void setId(Integer id) {

this.id = id;

}

/**

  • @return Returns the name.

*/

public String getName() {

return name;

}

/**

  • @param name The name to set.

*/

public void setName(String name) {

this.name = name;

}

/**

  • @return Returns the hasChildren.

*/

public Boolean getHasChildren() {

return hasChildren;

}

/**

  • @param hasChildren The hasChildren to set.

*/

public void setHasChildren(Boolean hasChildren) {

this.hasChildren = hasChildren;

}

public List getTreeNodes() {

ModelClass model = new ModelClass();

return (List) model.getTreeNodes();

}

public List getRootNodes() {

ModelClass model = new ModelClass();

return (List) model.getRootNodes();

}

public List getChildNodes() {

ModelClass model = new ModelClass();

return (List) model.getChildNodes(getParentId());

}

public static void main(String args[]) {

ModelClass model = new ModelClass();

model.getTreeNodes();

}

}

When I'm trying to deploy and run application I get the following exception:

"com.sap.tc.webdynpro.progmodel.context.ContextException: RecursiveNodeInfo(MainView.TreeNode.Child): you cannot add a recursive child to a mapped node mapped to a data node without recursion"

Can anybody help?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Evgeniy,

Looks like you have created non-recursive node in component-controller / custom-controller, and then map recursive node in view-controller to it.

If so, then simply make node in component-controller recursive (via adding recursion node). Supply function (if any) must reside in component-controller as well.

VS

Former Member
0 Kudos

Thanks a lot, Valery!

Seems as so it solved the problem completely.

Answers (0)