How to add a new row as a first record in a table

hi folks,

i am using the table component in my application.It is binded to a dataprovider. Now i want to add a new row at the top of the record in the table(i.e. whenever i am adding a new row it should be the first record in the table).Currently i am able to add a record at the end only.

please provide me a solution for this.

thanks & regards,

prasant

[389 byte] By [rpk@trat] at [2007-11-26 9:08:18]
# 1
Have you tried dataProvider.cursorFirst() before appending the row?
Sabir at 2007-7-6 23:24:25 > top of Java-index,Development Tools,Java Tools...
# 2

hi sabir,

I have tried the cursorFirst() method before calling the appendRow() method as follows:

if(dataprovider.canAppendRow())

{

dataprovider.cursorFirst();

Rowket rowkey = dataprovider.appendRow();

}

Still the rows are getting added at the end of the table component. Is there any other solution or do i need to include any other code along with it.

thanks & regards,

Prasant

rpk@trat at 2007-7-6 23:24:25 > top of Java-index,Development Tools,Java Tools...
# 3
Have you tried insertRow(beforeRow)?
dkible at 2007-7-6 23:24:25 > top of Java-index,Development Tools,Java Tools...