on 04-10-2008 8:48 AM
Hello @ all,
I am programming a webTool which should displayd data in a structure.
For this I have context like this:
Customer
SID
Responsibility
ServiceMgr
AccountMgr
and it should be display in a table like this (e. g.):
_______________________________________________
| System || Responsibility || ServiceMgr || AccountMgr |
Microsoft
+12345 William T. Tom F. Ralf C.
+45628 Martin J. Tom F. John K.
SAP
+87956 ... ... ...
I hope for help.
Thanks all
Marcus
Hi,
You need to create a recursive context structure to use treeByNesting.
Pl go through the following tutorial to under stand its use better
Creating a Tree Structure in a Table
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I know this tutorial. I did it so far.
But my problem is how to code the table structure when I have my contexts like I wrote before.
I think I need to create a Context with one ValueNode, RecursionNode, My whole contexts and other contexts (ChildrenLoaded, Expanded, IsLeaf)
Something more?
What is my further task?
Hi,
Your context Structure Should be as follows
Customers--->Node
Childrens--->RecursiveNode Based on Customers
Customer -->Attributes
SID
Responsibility
ServiceMgr
AccountMgr
ChildrenLoaded boolean
Expanded boolean
IsLeaf boolean
Map the respective attributes to the properties of table and tree by nesting.
Then populate the context wit some values as follows
Sample code
for(int x=0;x<2; x++)
{
IRootElement nodeElement = wdContext.nodeCustomers().createCustomersElement();
nodeElement.setSID(value);
wdContext.nodeCustomers().addElement(nodeElement);
// adding childrens
IRootElement nodeElementChild = nodeElement.node().createRootElement();
nodeElementChild.setSID(value);
nodeElement.node().addElement(nodeElementChild);
}
Regards
Ayyapparaj
So far I have created the context like you said.
Next I have create a Table (RootUIElementContainer > Apply Template) with the attributes "Responsibility", "ServiceMgr", "AccountMgr".
Then insert a MasterColumn and did the following:
childrenLoaded > Customers.ChildenLoaded
expanded > Customers.Expanded
isLeaf > Customers.IsLeaf
what should I do at next?
Regards
Marcus
Shure, that I have to do this in the Implementaion Tab of the Controller or of the View?
What about the Methods and Action. In the project "TutWD_TreeByNestingTableColumn" they're build before. What should I do?
Maybe you can give me the whole code to create the Master Column for my project?
I don't know where and how I have to implement...
Thank you
Regards
Marcus
Maybe it is easier for you to start with a flat table. Later you can try to use a hierarchical structure.
Context:
Rows (node, cardinality=0:N, supply function=supplyRows)
- Customer (string)
- SID (string)
- Responsibility (string)
- ServiceMgr (string)
- AccountMgr (string)
CustomerTable (Table)
CustomerTable.dataSource = Rows
Use table wizard to create table columns (use TextView as cell editors).
For testing, implement the supply function like
void supplyRows(...node...)
{
String[][] data = {
{"customer#1", "sid#1", "resp#1", "serviceMgr#1", "accountMgr#1"},
{"customer#2", "sid#2", "resp#2", "serviceMgr#2", "accountMgr#2"},
etc.
};
for (int i = 0; i < data.length. ++i)
{
IRowsElement row = node.createAndAddRowsElement();
row.setCustomer(data<i>);
etc.
}
}
Then you should see a table with the test data on the screen. In the next step, supply your real data from whatever backend model.
If this works, you can try to use a row grouping to avoid repeating the customer name for consecutive rows with the same customer. This is almost a hierachical representation.
If this all works, we can continue with your original requirement.
Armin
Hello again,
I've already the same problem. I create two view. one for writing testdata in the contexts and one with the Table (with MasterColumn).
In the first view my context is the follows:
Acc Attribute
Cust Attribute
ID Attribute
Res Attribute
Ser Attribute
for the second view (with the Table):
Customers Node
Childrens RecursionNode
AccountMgr Attribute
ChildrenLoaded Attribute
Customer Attribute
Expanded Attribute
IsLeaf Attribute
Responsibility Attribute
ServiceMgr Attribute
SID Attribute
and for the Component Controller:
Customers Node
Childrens RecursionNode
AccountMgr Attribute
ChildrenLoaded Attribute
Customer Attribute
IsLeaf Attribute
Responsibility Attribute
ServiceMgr Attribute
SID Attribute
when I try to deploy the App this Message will displayd:
("Abfrage" is the first View)
com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(Abfrage): cannot modify Cust because it is mapped and there is no active NodeElement to take the value
Maybe my Implementation-code is wrong.
Maybe I can get in contact to someone for e-Mailing my Project, because I don't know where the code should be edit,....
Thanks for help
Best Regards
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.