on 05-16-2007 4:44 AM
there is a hierachy lookup table A, and I want to get data from A.
but the following code does work properly:
WebTreeNode result = catalog..GetHierarchy(tableName,nodeID);
could anybody give some suggestion or solution of getting data from hierachy lookup table,
3x
Hi fei,
Please look at the following code.
I hope it will give you some clues...
private void showHierarchy() throws StringException
{
ResultSetDefinition rsd = new ResultSetDefinition(<code name of your hierarchy table>);
rsd.GetFields().Add(<code name of a field in your hierarchy table>);
Search search = new Search(<code name of your main table>);
WebTreeNode treeNode = catalogData.GetResultTree(search, rsd, 0);
printHierNameRecursive(treeNode, 0);
}
private void printHierNameRecursive(WebTreeNode root, int level) throws StringException
{
WebTreeNodeArray arr = root.GetChildren();
for (int i = 0; i < arr.GetSize(); i++)
{
for (int tab = 0; tab < level; tab++)
System.out.print("t");
String catName = arr.GetWebTreeNodeAt(i).GetValueAt(<code name of a field in your hierarchy table>).GetStringValue();
System.out.println(catName);
printHierNameRecursive(arr.GetWebTreeNodeAt(i), level + 1);
}
}
Regards,
Nir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.