on 04-09-2007 6:27 PM
Hi ,
I am working on a apllication where I am getting the data from database and dispalying that in a table in a view.I am getting the data in the result set.Pl help me how do I pass the result set values to Controller context.
Thanks in Advance
Hi,
You need to rip of the values from the ResultSet and need to assign it to the Context Attribute of the Table's Context node.
You can go thru the below pdf - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5f699f90-0201-0010-14a4-89501772...
It would be like
/ create a table
// create fields/columns
// add columns to the table
for( i=0;i<nodesize;i++)
{
// read value from RecordSet
// assign it to suitable table cell
//move to next record in the node and next row in the table
}
Thanks,
Raags
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no direct way to pass values from RecordSet to Context.
1. If your database table is Address with fields name, city, state.
2. Then you need to create a Value Node by name 'Address' in controller context
3. Add value attributes with name, city, state of type string.
4. Make sure the cardinality is 0..n
5. Now here comes your code..
6. Iterate thru ur RecordSet, get each records filed value
7. create the element of the 'address' node and assign the recordset's value to elements fields i.e, using setCity(), etc....
8. and makes ure you add the element to value node.. ie., wdcontext.nodeAddress.addElement(addresselement);
where addresselement is IAddressElement addresselement=wdcontext.nodeaddress.createAddresselement();
9. In this way you need to iterate and add the all records values from recordset to context
I hope you know how to access nodes/context of Controller from view code.
Thanks,
Raags
User | Count |
---|---|
85 | |
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.