I actually have a field that can be null (you can ignore inserting values
into it) but does not allow an empty string like " ". So I am checking
whether an empty string has been passed by the user, and if that's true I
want to remove the field from being updated( inserted). Is this feasible?
I have done something similar but I was changing the values other than
removing the fields. e.g. I will put:
fieldValues.put("entry_key", entryValue);
and I will have the value of "entry_key" changed. I assumed that since this
worked I can also put:
fieldValues.remove("entry_key")
to prevent "entry_key" from being inserted/updated.
Unfortunately the later seems not to be working. Any ideas?
> -----Original Message-----
> From: shawn [SMTP:[EMAIL PROTECTED]]
> Sent: 29 January 2003 08:50
> To: J M Okomba
> Cc: dbf
> Subject: RE: [dbforms] Removing entry from fieldValues
>
> It just applies to primary keys
>
> What are you trying to do anyway? Just curious.
>
> On Wed, 2003-01-29 at 17:17, J M Okomba wrote:
> > Thanks Shawn,
> >
> > But the field I am changing (removing) is not a key field (i.e. set
> > isKey="true" in config file). Or does the rule apply to any field?
> >
> > > -----Original Message-----
> > > From: Shawn [SMTP:[EMAIL PROTECTED]]
> > > Sent: 29 January 2003 08:10
> > > To: J M Okomba
> > > Cc: dbf
> > > Subject: Re: [dbforms] Removing entry from fieldValues
> > >
> > > Dear JM,
> > >
> > > Please see the following from the new guide which is for the upcoming
> > > 1.1.3pr2 release
> > >
> > > CH2 CHANGING KEY VALUES IN INTERCEPTORS
> > >
> > > Carlos Anjos points out that this can not be done.
> > > Apparently 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.
> > >
> > > ----- Original Message -----
> > > From: "J M Okomba" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, January 29, 2003 4:57 PM
> > > Subject: [dbforms] Removing entry from fieldValues
> > >
> > >
> > > >
> > > > Using a preInsert (or preUpdate) I need to remove an entry from the
> > > values
> > > > to be inserted (updated). So I do:
> > > >
> > > > fieldValues.remove("key");
> > > >
> > > > And when I do:
> > > >
> > > > System.out.println(fieldValues + " - fieldValues");
> > > >
> > > > I can see that the entry was removed.
> > > >
> > > > But dbforms still attempts to insert the value, causing an error.
> > > >
> > > > I there something I am missing out? I will appreciate any help.
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > 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
> --
> 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