on 02-09-2006 7:31 AM
Hi all,
I have to bind result with a table.The result is in the form of 2-dimensional array.How i can create 2-dim array in context?How can i bind this with a table?
Please give me some idea about this.
Thanks all.
Suppose the result has 2 columns say name and age.
1.create a node say node_table
2.create 2 attributes name and age by right clicking the node and selecting create attributes
You will have to pass the values from array to node
Suppose the array is arr[][]
write this code in init of view by selecting implementation tab
for(int i=0;i<no of rows;i++)
{
ele = wdContext.nodeNode_table().createTabledataElement();
ele.setName(arr<i>[1])
ele.setName(arr<i>[2]) wdContext.nodeTabledata().addElement(ele);
}
Also right click on the transparent container in the layout of the view and apply template
select table and select the attributes you have to show in table in this case name and age
Hope this helps you
Regards
Rohit
Message was edited by: Rohit Radhakrishnan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to all for giving ur suggessions.
By
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Madhu,
Since you are new this link may help to assign points
https://www.sdn.sap.com/irj/sdn/submitcontent?rid=/webcontent/uuid/e7b06b5c-0501-0010-3c80-f82a07c98... [original link is broken]
Hope this helps you
Regards
Rohit
Hi Madhu,
Yoe can not bind directly arrays to table. I would suggest you following approach:
1) create node without any attributes;
2) populate table and node dynamically with columns and attributes and bind them in wdDoModifyView with data from array (see appropriate tutorial "How to use dynamic programming in Web Dynpro applications?" https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web dynpro tutorial and sample applications.faq#q-17);
3) create supply method for datasource node and fill node with node elements there with data from array.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Madhu,
can u please explain ur requirement a bit clear.
what data you are getting and from where u are getting that data.how u want to display that data
Regards
Naidu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
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.