craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > Non-Database mode - Dataobjects/EJB/Hibernate/File/Array/Vector Post New Topic   Post A Reply
getRowObject Problem printer friendly version
next newest post | next oldest post
Author Messages
syedj
Private

Gender: Male
Location:
Registered: Apr 2008
Status: Offline
Posts: 2

Click here to see the profile for syedj Send email to syedj Send private message to syedj Find more posts by syedj Edit or delete this message Reply w/Quote
Posted Monday, April 21, 2008 @ 10:24:45  

Hi there,

I have quicktable displaying contents from the database and have added a button next to the Control Panel, which when clicked fetches the the selected row(s) and processes them.

I am having issues with fetching the selected Row Objects(I am using Hibernate) when I use dbTable1.refreshDataObject(queryList,methodNames). The dbTable1.getRowObject() just returns an empty String instead of the Object I stored when building the DBTable. On the other hand, when I use dbTable1.refreshDataObject(queryList,null) , the dbTable1.getRowObject() does return the Object I stored.

Any help/comments/suggestions will be appreciated.

Regards,

Syed.

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Tuesday, April 22, 2008 @ 03:07:10  

we will look into this and get back to you soon.
syedj
Private

Gender: Male
Location:
Registered: Apr 2008
Status: Offline
Posts: 2

Click here to see the profile for syedj Send email to syedj Send private message to syedj Find more posts by syedj Edit or delete this message Reply w/Quote
Posted Tuesday, April 22, 2008 @ 15:57:47  

Thanks for your reply. Just to let you know, I've found a work around to the issue, but kind of a long way though.

I am filling my DbTable using refreshDataObjects(queryList,methodNames).
Besides containing all the columns I need to display, the the array methodNames also has the method that fetches the primarykey of the table. Then, when I click the button to process the selected rows, I use dbTable.getSelectedRows() and get all row indices that were selected and then iterate through the indices and fetch the primarykey on each as shown below:

for(int row=0;row< selectedRows.length; row++)
{
Long queryid = (Long)dbTable1.getValueAt(selectedRows[row],0);
}

Please let me know if anyone finds a better way to do it.

Thanks,

Syed.

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Wednesday, April 23, 2008 @ 21:48:55  

We tested this scenario and in both cases the rowObject was properly returned.

Please enable debug using dbTable.debug=true immediately after instantiating DBTable. Check the stdout logs for any errors.

At the place where you are not getting the rowobject, add the following debug code and see what is the row data.

Vector v1 = dBTable1.getDataVector();
for(int i=0; i< v1.size(); i++ )
{
Vector v2 =(Vector)v1.elementAt(i);
for(int j=0; j< v2.size(); j++ )
System.out.print(v2.elementAt(j) + "|");
System.out.println();
}

If you still have issues, please send me a small code where you can reproduce this issue.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios