cancel
Showing results for 
Search instead for 
Did you mean: 

not displaying first row in the table

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

tx

nikhil_bose
Active Contributor
0 Kudos

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

sanyev
Active Participant
0 Kudos

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

former_member201361
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Correct. Maybe he has set cardinality=1:n instead of 0:n. In this case the runtime would create one node element automatically.

Armin

Former Member
0 Kudos

hi Sushma,

this may be because of selection value change the selection as 1.and cardinilty as 0 to n.

Former Member
0 Kudos

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

Former Member
0 Kudos

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