Home » Developer & Programmer » Forms » How to know if user has updated a field... (Oracle 10g forms)
How to know if user has updated a field... [message #385457] Mon, 09 February 2009 15:15 Go to next message
urnikhil
Messages: 42
Registered: March 2008
Member
Hi,

How can we know if an item(:BLOCK.ITEM) has been updated by the user and not by the form triggers?

I have code that needs to be executed only if user changes the value in the item.

Thanks,
Nikhil.
Re: How to know if user has updated a field... [message #385459 is a reply to message #385457] Mon, 09 February 2009 15:37 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What difference does it make? I mean, why should you care who changed the value? In my opinion, if it is changed, it is changed -> do whatever you need to do. For such problems, WHEN-VALIDATE-ITEM trigger is to be used.
Re: How to know if user has updated a field... [message #385483 is a reply to message #385459] Mon, 09 February 2009 20:30 Go to previous messageGo to next message
urnikhil
Messages: 42
Registered: March 2008
Member
Hi Littlefoot,

Thanks for your prompt reply.

Let me explain my situation more clearly. I have two items in the form that are related. Let's consider them as ITEM1 and ITEM2

I have a when-validate-item trigger on ITEM1 that populates ITEM2.
Our requirement is not to overwrite ITEM2 if it is updated by the user. So I need to know if user has updated the field or not.

Thanks.
Re: How to know if user has updated a field... [message #385488 is a reply to message #385483] Mon, 09 February 2009 22:22 Go to previous messageGo to next message
sasipalarivattom
Messages: 121
Registered: June 2007
Location: Cochin ( INDIA )
Senior Member
Hi Dear,

the better way is in the when validate trigger of item1, check whether item2 is null or not.
if it is null , then update the field with your value.
if not, leave it.


Regards,
Sasi..
Re: How to know if user has updated a field... [message #385498 is a reply to message #385457] Mon, 09 February 2009 23:06 Go to previous messageGo to next message
urnikhil
Messages: 42
Registered: March 2008
Member
Hi sasi,

Those two items are populated at form start up. So we cannot use the logic you mentioned as ITEM2 will not be null.

Thanks.
Re: How to know if user has updated a field... [message #385510 is a reply to message #385498] Mon, 09 February 2009 23:42 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use a third non-display non-database item. Set it in the WVI of one item and then test it in the WVI of the other item.

This will NOT recognise the situation where the user 'changes' the contents of an item to itself, that is, when the use changes 'dog' to 'dog'. All that Forms will see is that the user has replaced the whole of an item with new text. It will not see that the new and old text are the same.

A method to handle this is to duplicate the two items by a pair of non-display non-database items and then compare the contents of the displayed item against the contents of the non-displayed item.

David
Previous Topic: Hijri Dates
Next Topic: Passing parameters from JSP to Oracle forms..
Goto Forum:
  


Current Time: Mon Feb 03 18:04:18 CST 2025