Home » Developer & Programmer » Forms » To erase value when cursor leaves the field (10g)
To erase value when cursor leaves the field [message #655695] Thu, 08 September 2016 08:08 Go to next message
kumarravik
Messages: 32
Registered: January 2016
Location: delhi
Member
Hi,

I have display item which shows messages as per the entry in different text fields of the form. i have when_validate_item trigger on every text fields for this.

as if text_field1
then display_item := finance;
if text_field2
then display_item :=Marketing ;

The problem is, until i enter any data in another text_item, the display item keeps showing the message of previous text_item.

I want that when user moves out from the text_item1, the display_item should be cleared, and become blank.

I tried to write "when_new_Item_instance trigger", but in this case the message doesn't even appear in first place (overrides the trigger when_validate_item );

Any suggestion if you guys can provide..

let me know if you have any query regarding the requirement.


Re: To erase value when cursor leaves the field [message #655696 is a reply to message #655695] Thu, 08 September 2016 08:17 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Why don't you usePRE-Text-Item or POST-Text-Text
Re: To erase value when cursor leaves the field [message #655698 is a reply to message #655696] Thu, 08 September 2016 08:52 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
As LF suggested in the other thread, it sounds like you want the hint or tooltip properties rather than a display item.
Re: To erase value when cursor leaves the field [message #655703 is a reply to message #655696] Fri, 09 September 2016 01:11 Go to previous messageGo to next message
kumarravik
Messages: 32
Registered: January 2016
Location: delhi
Member
Hi Azam,

I tried the post-text trigger, but again same issue.

When_validate_item display the text but when i applied to post_text trigger to erase or remove the display text, the text doesn't appear at first place (probably the text appears and before i can see, post_text trigger make removes it). here the piece of code..

when_validate_item
if text_box1 then "display the text" end if
post_text_item

declare
curr varchar2(50) :=:System.Cursor_ITEM;
begin
if curr == "textItem1" then no action
else
clear the message
end if
end


Another option of tool-tip as suggested by CookieMonster

The message appears, but customer is not happy, he want to display the text at the bottom of the form in bold hence have to scrap this plan.
Re: To erase value when cursor leaves the field [message #655705 is a reply to message #655703] Fri, 09 September 2016 03:13 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
1) Please read and follow How to use [code] tags and make your code easier to read?
2) If you want us to spot mistakes in your code then you need to actually post the real code not pseudo code.
3) I have no idea why you're using WVI here. It fires when the user navigates out of field if they've changed it (plus there are settings that can make it fire on save instead). It is useless for what you want. If you want this for one field only then pre-text-item or when-new-item-instance is the combination you need. If you want it for multiple items then a block or form level when-new-item-instance is probably simplest.
Re: To erase value when cursor leaves the field [message #655706 is a reply to message #655705] Fri, 09 September 2016 05:25 Go to previous messageGo to next message
kumarravik
Messages: 32
Registered: January 2016
Location: delhi
Member
Sure, Here YOU GO.. WHEN_VALIDATE_ITEM CODE


begin

if
:BLK_20.code not in ('000','070','072','073') then
:disMsg := 'code '||:BLK_20.code||' ' states the country' ;


if
:DESC_ITEM not like '% #Parameters#' then
:DESC_ITEM := :DESC_ITEM ||' #Parameter#';
END IF;
ELSE

:disMsg :=NULL;
END IF;


POST_TEXT_ITEM CODE (TO CLEAR OR REMOVE THE DISPLAY ITEM TEXT)

Declare
CURR varchar2(50) :=:System.Cursor_ITEM;

BEGIN
IF CURR NOT LIKE 'BLK_20.code' THEN
:disMsg :=NULL;
END IF;

END;
Re: To erase value when cursor leaves the field [message #655709 is a reply to message #655705] Fri, 09 September 2016 08:37 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
cookiemonster wrote on Fri, 09 September 2016 09:13
1) Please read and follow How to use [code] tags and make your code easier to read?
It contains instructions, please follow them.

My point about WVI stands - it sets the value too late to be any use - you need to use pre-text-item or when-new-item-instance.
The code you've posted isn't the actual code - you've got mismatched quotes if nothing else.
Never use like without a wild card. Use = if you don't want them.

I'd check what :System.Cursor_item returns - it's probably not in the case you think it is.
Previous Topic: adding text to a field
Next Topic: Locking to win last update ?
Goto Forum:
  


Current Time: Fri Mar 29 09:12:21 CDT 2024