on 01-30-2009 10:01 AM
Hi
I created web dynpro application. In that table,,
Cardinality -
0 to n
Selection -
0 to n
public void wdDoInit()
{
//@@begin wdDoInit()
wdContext.currentLeaveElement().setLocation("1");
for (int i = 0; i < EMP.length; i++)
{
IPrivateEtrecLeaveEligView.ILeaveElement element = wdContext. createLeaveElement();
element.setDepartment(EMP<i>[0]);
element.setLeaveType(EMP<i>[1]);
element.setYear(EMP<i>[2]);
element.setTimeSpan(EMP<i>[3]);
element.setNumofdays(EMP<i>[4]);
element.setLevel(EMP<i>[5]);
wdContext.nodeLeave().addElement(element);
}
//@@end
}
In tha last declaration,,,,,,
private static final String EMP[][] =
{
{ "Supply Chain", "Annual Leave", "2008", "Yearly", "20", "JC-16 Manager grade"},
{ "Finance", "Sick Leave", "2008", "Yearly", "23", "WL-2A"},
{ "Brands & Development", "Monthly Leave", "2008", "Monthly", "23", "WL-4A"},
{ "Supply Chain", "Annual Leave", "2008", "Yearly", "23", "WL-5A"},
{ "Finance", "Sick Leave", "2008", "Yearly", "23", "WL-6A"}
};
But its not taking first row data in the table....
will any one please help me where i did mistake.
Regards
Sushma
tx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi sushma,
code looks fine.
1. check the cardinality of the node Level
2. for the table, check the firstVisibileRow property is not set to 1; it is 0
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushma,
Your code is perfectly fine. just change the cardinality of the node Leave from 1:n to 0:n and it will work just fine.
Regards,
Sanyev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushma,
there is no problem in the below code :
for (int i = 0; i < EMP.length; i++)
{
IPrivateEtrecLeaveEligView.ILeaveElement element = wdContext. createLeaveElement();
element.setDepartment(EMP[0]);
element.setLeaveType(EMP[1]);
element.setYear(EMP[2]);
element.setTimeSpan(EMP[3]);
element.setNumofdays(EMP[4]);
element.setLevel(EMP[5]);
wdContext.nodeLeave().addElement(element);
}
//@@end
}
but in the doinit method u have written this line :
wdContext.currentLeaveElement().setLocation("1");
which means that , u have create a LeaveElement some where before this line and thats the reason the first row of ur table is empty.
if the location value is same for all rows(for all leave element) then in the for loop set the value of the location as shown below:
element.setLocation("1");
Hope it helps
Thanks and Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Sushma,
this may be because of selection value change the selection as 1.and cardinilty as 0 to n.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cardinality -> 0..n
Selection -> 0..1
Code as.
IPrivateExperimentView.ILeaveElement element;
for( int i = 0; i < EMP.length; i++)
{
element = wdContext. createLeaveElement();
element.setDepartment( EMP<i>[0]);
element.setLeaveType(EMP<i>[1]);
element.setYear(EMP<i>[2]);
element.setTimeSpan(EMP<i>[3]);
element.setNumofdays(EMP<i>[4]);
element.setLevel(EMP<i>[5]);
wdContext.nodeLeave().addElement(element);
}
vinod v
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushma,
Please check the below code written by you.
for (int i = 0; i < EMP.length; i++)
i think it should be
for (int i = 0; i < EMP.length-1; i++)
Regards
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.