Thanks for the pointers. You're a star :)
Paul

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]] On 
> Behalf Of shawn
> Sent: 25 January 2003 00:58
> To: [EMAIL PROTECTED]
> Subject: RE: AW: [dbforms] RE: Interceptor - preUpdate - 
> "feature" shouldbe documented
> 
> 
> I believe it's buried in the request.
> 
> If I recall correctly I do something like:
> 
> String action = 
> ParseUtil.getFirstParameterStartingWith(request,"ac_");
> 
> String tableId = ParseUtil.getEmbeddedString(action,2,'_');
> 
> String keyId = ParseUtil.getEmbeddedString(action,3,'_');
> 
> String keyValuesStr =
> ParseUtil.getParameter(request,"k_"+tableId+"_"+keyId);
> 
> Hashtable v=GetKey.getKeyValues(keyValuesStr);
> 
> and that hashtable will be your old values.  
> 
> notes:  the '2' from tableId and '3' from keyId will be diff 
> for you.  I think they have
> to do with the tableId and something else, can't recall now 
> and don't have time to look.  Should
> have documentented my own classes better.
> 
> Also the GetKey method is from someplace within Dbforms but I 
> dk where.  I just cut it out and
> moved it to my own getkey method maybe changing it a little 
> or maybe using it as is. 
> 
> Sorry this is not a 100% complete answer but I think points 
> you in the right dir.
> 
> It took me forever to figure out how to parse those strings 
> to get the values I needed.
> 
> Shawn
> 
> On Sat, 2003-01-25 at 07:41, Paul Mahoney wrote:
> > Interesting. Must remember this. However I don't want to 
> play with the
> > new primary key field value, but do need to identify the original
> > values. Then must be held somewhere, but how do I get to them?
> > 
> > Paul
> > 
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of 
> > > Carlos Anjos
> > > Sent: 24 January 2003 18:25
> > > To: Henner Kollmann
> > > Cc: [EMAIL PROTECTED]; dbf
> > > Subject: Re: AW: [dbforms] RE: Interceptor - preUpdate - 
> > > "feature" should be documented
> > > 
> > > 
> > > Apparently so. I just found out the hard way.
> > > Apperently if a field is marked with isKey="true" in the 
> config file,
> > > the preDelete and preUpdate methods disregard any changes to it.
> > > I had a situation where i did some processing in the 
> preDelete method
> > > and then I wanted to allow the operation, but on a different row.
> > > So I changed the values in the fieldValues hashtable, but 
> still the
> > > orginal row got deleted.
> > > After banging my head for where in my code the error was, 
> I finally
> > > understood that dbforms was ignoring the change to that attribute.
> > > A friend of mine went through dbforms deleteEvent code 
> and confirmed
> > > that.
> > > 
> > > Should/could this behaviour be changed ?
> > > If not, it should be documented in the users guide that you cannot
> > > change the key values with interceptors !!!
> > > 
> > > Carlos.
> > > 
> > > Henner Kollmann wrote:
> > > > 
> > > > With the primary key!!!! Never change it - otherwise the 
> > > update will not
> > > > work!
> > > > 
> > > > Regards,
> > > > Henner
> > > > 
> > > > >
> > > > > Hi Carlos
> > > > >
> > > > > The problem is that the primary key may be being updated.
> > > > > Thus I need to get a reference to the table row being updated
> > > > > but the fieldValues hash may not hold the original primary
> > > > > key. I can't help thinking that the innards of dbforms must
> > > > > be able to identify the row to be updated, else how 
> does it do it?
> > > > >
> > > > > Many thanks for responding
> > > > >
> > > > > Paul
> > > > >
> > > > > >
> > > > > > Hi Paul.
> > > > > > Perhaps you could get from the fieldValues hashTable some id
> > > > > > of the row you are tying to update and do some sql 
> query using
> > the 
> > > > > > connection provided, to find what the current values are.
> > > > > >
> > > > > > Regards,
> > > > > > Carlos.
> > > > > >
> > > > > >
> > > > > > > > Dear Team
> > > > > > > >
> > > > > > > > I have a preUpdate interceptor installed and 
> the fieldValues
> > hash
> > > > > > > > tells me the new (updated) column values.
> > > > > > > >
> > > > > > > > Is there a way to get to the current (pre update) column
> > values
> > > > > > > > for the target row?
> > > > > > > >
> > > > > > > > I need this information to decide if the update should
> > proceed.
> > > > > > > >
> > > > > > > > Many thanks
> > > > > > > >
> > > > > > > > Paul
> > > 
> > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.NET email is sponsored by:
> > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> > http://www.vasoftware.com
> > _______________________________________________
> > DbForms Mailing List
> > 
> > http://www.wap-force.net/dbforms
> -- 
> shawn <[EMAIL PROTECTED]>
> 
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> DbForms Mailing List
> 
http://www.wap-force.net/dbforms



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to