on 01-31-2008 11:37 PM
I have a start view and an result view.
On the result view table I would like to add a table with a few columns.
The data can also be static or hard coded since this is a prototype approach.
Can forum member's please advise on how to go about the same
Hi,
Create a context node say "Details"
Under that create to attributes "Name", "ID" of datatype string.
You can create the above context structure either in controller and map to the views or else you can create them in the view.
Now switch to the Layout of the view,
Right click on the view You will See "Template"
select the table template and this wizard will guide you through the creation of the table.
To add some data to the context
in the init of the controller You have to do the following
for(int x=0; x<10; x++)
{
IDetailsNodeElement element = wdContext.nodeDetailsNode().createAndAddDetailsNodeElement();
element.setName("Abcd");
element.setID("123");
}
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ayyaparaj
Your approach worked.I am able to see a table in my view.
However the code snippet you provided is having compilation issues
for(int x=0; x<10; x++)
{
IDetailsNodeElement element = wdContext.nodeDetailsNode().createAndAddDetailsNodeElement();
element.setName("Abcd");
element.setID("123");
}
1.>
Is this because i have added Details node to the context of the result view?
2.>
Is there any other thing i am missing?
Hi,
Is the complie issue for createAndAddDetailsNodeElement() method????
IDetailsNodeElement element = wdContext.nodeDetailsNode().createDetailsNodeElement();
element.setName("Abcd");
element.setID("123");
wdContext.nodeDetailsNode().addElement(element);
If so then you have to change the code a bit as mentioned above.
Is this because i have added Details node to the context of the result view?
You have to write the above code in the java file where your node exists.
Ex: If you have the node in the controller and mapped to the view, you have to write this code in the controller.
If the node is only in the view, obviously the code should be in the java file for the view.
Regards
Ayyapparaj
Hi Stride,
In the code given by ayyaparaj
change this
for(int x=0; x<10; x++)
{
IDetailsNodeElement element = wdContext.nodeDetailsNode().createDetailsNodeElement();
element.setName("Abcd");
element.setID("123");
wdContext.nodeDetailsNode().addElement(element);
}
The last sentence should be added in the code .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai stride,
refer to these pdf files which will help you adding tables in view.Its give you the step by step method to add table.check it.
//important//
//additional//
https://www.sdn.sap.com/irj/sdn/?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#38
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stride,
As mentioned earlier this is one of the approach , you can also refer to the sample codes provided by SAP these can be quite useful for learining webdynpro
Link:[https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2]
Thanks
Pankaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a context node with the needed attributes in the component controller and map it from both view controllers. In the result view, add a Table UI element to the view layout, use the binding wizard for creating the table columns with suitable editors. That's it.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.