Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what techinque i must use

Status
Not open for further replies.

kuha

Technical User
Oct 23, 2001
14
US
Hi Friends,
I have a situvation like this,
1.User will update a record. Next time he opens the view update screen, the feilds last updated must be highlighted.
i have two tables one master and one user. I have to compare the user table with master and if i find all the feilds in both the table matches then i have to display the feild without any highlight, if i find any feilds changed in the user compared to master table then i have to display these feild highlighted.
2.If user updates any feilds i have to pass only those feilds which are changed by the user to the data base, so that only those feilds which are changed will get updated.

My idea of solving the above problme is,
User table will be having all the feilds null execpt feilds which user updates, so i am going to use hashtable, one for User table and one for master table. I will compare elements of both the hashtable and if i find an element in User table which are not in Master table then i will highlight this feild while displaying.
During updating i have to send only feilds which are changed, i don't know how to do this and also i don't know what technique i am using for the above is good or not.
Please suggest me a easy go, so that my problem will be solved.
I know hashtable will not except NULL, so what collection object i have to use.
Please suggest me regarding this issue.
Thanks in advance for all the help.
Harish
 
try this.

create a data object containing all the data displayed initially to the user. call this a User object or something. define all your own data type. use strings, its easier. store this locally.
let the user update whatever. read this data back from the user into a new data object.

compare and contrast the new against the old???

if( newObject.getSomeFiled().equals( oldObject.getSomeFiled() )
{
updateAndHighlightThisField();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top