Regarding When-timer-expired trigger
Hi,
My requirement is to display time .From my understanding i think every time
when-timer-expired shuttle between client and middle tier for this purpose for
every expiry of time .This i feel degrades the performance.
Is there any workaround available so that the database time is fetched for the first
time and thereafter refreshing could takeplace in the client-side
Thanks in advance
regards,
prabakaran.s
Here is the code:
package oracle.forms.fd;
import java.awt.AWTEventMulticaster;
import java.awt.Color;
import java.awt.Cursor;
import oracle.forms.handler.IHandler;
import oracle.forms.properties.ID;
import oracle.forms.ui.VTextField;
* A PJC to have a textfield blinking
* @author Francois Degrelle
* @version 1.0
public class BlinkTextField extends VTextField implements Runnable
public final static ID START = ID.registerProperty("START");
public final static ID STOP = ID.registerProperty("STOP");
public final static ID SETBLINKRATE = ID.registerProperty("SETBLINKRATE");
public final static ID SETFGCOLOR = ID.registerProperty("SETFGCOLOR");
public final static ID SETBGCOLOR = ID.registerProperty("SETBGCOLOR");
static Thread runner ;
protected int seconds = 400 ; // milliseconds
private Color cdefFG = null ; // default background color
private Color cdefBG = null ; // default foreground color
private Color cFore = null ; // blinking foreground color
private Color cBack = null ; // blinking background color
private boolean bSwitch = true ;
private IHandler m_handler;
public BlinkTextField ()
super();
public void init(IHandler handler)
m_handler = handler;
super.init(handler);
cdefFG = this.getForeground() ;
cdefBG = this.getBackground() ;
* switch color to simulate the blinking process
public void run()
Thread theThread = Thread.currentThread();
while (runner == theThread)
try{
Thread.sleep(seconds);
} catch (InterruptedException e) { }
if(bSwitch)
if(cBack != null) this.setBackground(cBack);
if(cFore != null) this.setForeground(cFore);
else
this.setBackground(cdefBG);
this.setForeground(cdefFG);
bSwitch = ! bSwitch ;
private void startTimer()
if (runner == null )
runner = new Thread(this);
runner.start();
private static void stopTimer()
if (runner != null )
runner = null;
public boolean setProperty(ID property, Object value)
if (property == START) // start the blinking
startTimer() ;
System.out.println("** Start **");
return true;
if (property == STOP) // stop the blinking
System.out.println("** Stop **");
stopTimer() ;
return true;
else if (property == SETBLINKRATE) // set the cursor blink rate
int i = Integer.parseInt(value.toString());
seconds=i;
System.out.println("** SetRate="+seconds+ " miliseconds");
return true;
else if (property == SETFGCOLOR) // set the foreground color
cFore = getColor(value.toString()) ;
System.out.println("** SetFGColor="+cFore);
return true;
else if (property == SETBGCOLOR) // set the background color
cBack = getColor(value.toString()) ;
System.out.println("** SetBGColor="+cBack);
return true;
else
return super.setProperty(property, value);
// expects r,g,b values separated by commas
public Color getColor(String colourValue)
try{
int r,g,b;
int rPos, gPos;
rPos = colourValue.indexOf(",");
gPos = colourValue.indexOf(",", rPos + 1);
if (rPos < 1 || gPos < 1 || gPos + 1 == colourValue.length()) {
throw new Exception("Invalid colour");
r = Integer.parseInt(colourValue.substring(0, rPos));
g = Integer.parseInt(colourValue.substring(rPos + 1, gPos));
b = Integer.parseInt(colourValue.substring(gPos + 1));
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) {
throw new Exception("Invalid colour");
return new Color(r,g,b);
catch(Exception e) {
return new Color(0,0,0);
}Francois
Similar Messages
-
WHEN-TIMER-EXPIRED
declare
var number :=10;
v_al char(3);
v_al_ti date;
begin
for i in 1..var loop
:control.showdate := TO_CHAR(SYSDATE,'DD-MONTH-YYYY');
:control.showtime := TO_CHAR(SYSDATE,'HH24-MI-SS AM');
select alarm, alert_date, alert_time
into v_al, v_al_da, v_al_ti
from remind
where alarm='ON';
if v_al = 'ON' AND
v_al_ti = to_char(sysdate,'HH24-MI-SS AM') AND
v_al_da = to_char(sysdate,'DD-MONTH-YYYY')then
message('alert is on ');
end if;
if var =9 then
var:= var+1;
end if;
end loop;
end;
THE CLOCK WORK BUT THE FORMAT MASK GIVE ERROR.
I WANT TO RAISE A MESSAGE WHEN AN REMINDER ENTRY HAVE ALARM = 'ON'
AND DATE = SYSDATE
AND TIME = SYSDATE.
THE TABLE HAVE FOLLOWING COLUMNS.
SQL> desc remind;
Name Null? Type
RE_ABOUT VARCHAR2(100)
ALARM CHAR(3)
ALERT_TIME DATE
ALERT_DATE DATE
THANKS IN ADVANCE.
REPLY ME ON MY EMAIL.
MUHAMMAD NADEEM
MARDAN (PAKISTAN)
[email protected]
+92-0301-8334434Hi Nadeem,
Change these two lines of code:
:control.showdate := TO_CHAR(SYSDATE,'DD-MONTH-YYYY');
:control.showtime := TO_CHAR(SYSDATE,'HH24-MI-SS AM');
Try with replace the above with select statement like below.
select TO_CHAR(SYSDATE,'DD-MONTH-YYYY'), TO_CHAR(SYSDATE,'HH24-MI-SS AM') INTO :control.showdate, :control.showtime From dual;
Cheers -
Raise form_trigger_failure does not work in when-timer-expired trigger
hi everbody,
i create timer (no repeat) in when-validate-item trigger for an item then in timer i use raise form_trigger_failure for not posting related item.but raise form_trigger_failure not work in timer and cursor go next item ? do you say anything for that ? thanks..when your validation runs ok, then and only then you should create the timer and in the WTE you navigate to the other item.
Think about: The WTE-trigger runs after the when-validate-item. It runs not within the WVI. That's the reason why you cannot cancel the WVI with the WTE.
Only the WTE can be stopped with the Form_Trigger_Failure. -
GO_FORM when TIMER-EXPIRED
Just want to know if I am doing something wrong
or if it's another feature of Forms. I have a
GO_FORM within an IF statement in the (repeating)
WHEN-TIMER-EXPIRED trigger. It all goes well until
the IF statement evaluates to a value that makes
GO_FORM the case, the repeating timer seems to go
dead after GO_FORM switches the focus to the
specified form. Any comments? Thanks in advance.Hi Eugeniy,
The original WBP trigger has already the following code:
go_item('bijz.click_datum');
do_key('list_values');
The section where copy ('0','GLOBAL.save_mouse_record'); is mentioned is part of the code that Metalink offered me, look at:
Note 266535.1 How to call to a calender window against an unbound item via an LOV button.doc
Best regards,
Ronny. -
When-Timer-Expired not firing if LOV is open
In my form I have a when-timer-expired trigger that kicks the user out of the form if there is no activity for one minute. But if the LOV is open the when-timer-expired trigger is not firing.
Thanks,yeah !
if the form starts a db-function or a host-command or a lov - then the form isn't able to do something else parallel to this...
e.g. :
WHEN-BUTTON-PRESSED :
IF show_lov () THEN
END IF;
if the lov works different, then you have parallel working program units. In this case :
a WHEN-BUTTON-PRESSED and a WHEN-TIMER-EXPIRED
and this is today impossible in Forms -
Webutil demo problems - WHEN-TIMER-EXPIRED error
Hi there,
I have just installed the 10.1.2 forms no problems. I then downloaded the demo of webutil from OTN and cannot get it to run properly. Can anyone help.
I initially had to rename the webutil.pll (i renamed to webutil_lib.pll as recommended in an earlier forum) file to overcome an initial error and now I can at least see the runtime canvas. I dropped and re-attached the attached libraray for this pll file (Is this all I have to do?)
The problem is I immediately get the error FRM-40735:WHEN-TIMER-EXPIRED trigger raised unhandled exception ORA-06508 in the console. This error continues for every event I do that has a trigger associated, ie changing tabs or pressing buttons, the only difference in the error message is the trigger name.
I can see the canvas and various items on the tab sheet but none of the triggers that refernce webutil appear to work.
I presume I have missed something simple, possibly when I renamed the .pll file.
Any ideas.
DougDougo,
I checked our bug database for this topic and couldn't find anything reported. Can you file a TAR with support to have them analyzing your problem. (metalink.oracle.com)
Frank -
Hi everyone,
This is my first time using this trigger and i dont really catch what to do to make it fire. Arwind advices me to use it to make the valus of the item blink. The way i see it it should work but i guess i'm missing something...could u plz help me find what i'm missing here.
Here is the only code i have for the trigger.
DECLARE
id_item ITEM;
timerid TIMER := FIND_TIMER('BLINK');
BEGIN
if :prix_en_vigueur is not null then
/*--- Make the item blink ---*/
id_item := find_item('PRIX_EN_VIGUEUR');
set_timer(timerid, 1000, REPEAT);
if get_item_property('id_item',DISPLAYED) = 'PROPERTY_TRUE' then
set_item_property(Id_item,
DISPLAYED,PROPERTY_FALSE);
else
set_item_property(Id_item, DISPLAYED,PROPERTY_TRUE);
end if;
end if;
END;
Does it have something to do with the set_timer or delete_timer and if so how should i use them.
Thanx in advance for ur replies.
nullYou have the when-timer-expired defined at form level. In it you should first have a call to get_application_property(TIMER_NAME), that returns the name of the timer that has made the trigger fire, depending on which you perform what you have to do under those circumstances.
How to make it fire? In whatever trigger you find appropriate you call set_timer, that starts the countdown for the number of milisecs you specify that finally generates the "Timer-Expired" event which makes the trigger fire.
Regards,
BD -
I NEED TO RUN WHEN-TIME-EXPIRED
AFTER PRESS PTN
BUT DONT KNOW HOWThis sound like a Oracle Forms question.
You might get more response in the designated forms forum here
Forms -
Timer --what you type gets lost on other forms when timer expires
I am using a timer that works fine on this one form. The problem lies you move to a different form that does not have a timer and start typing and if the timer fires at that time while you are typing the focus moves to the form with the timer but it appears that the other form is still there infront.But what you type gets lost at the moment the timer expires.
I am using go_block on when timer expired form.
Any good way t handle this ?I am using a timer that works fine on this one form. The problem lies you move to a different form that does not have a timer and start typing and if the timer fires at that time while you are typing the focus moves to the form with the timer but it appears that the other form is still there infront.But what you type gets lost at the moment the timer expires.
I am using go_block on when timer expired form.
Any good way t handle this ? -
When-timer-expired hit the cursor position
Some of our forms sometimes have timers running, to monitor
progress of this and that. We've found that if the timer
expires when you're typing in a form field, there's a tendency
for the cursor to momentarily move to the beginning of the field
then jump back to roughly where it had been. If you're just
typing away without paying attention, this can be messy.
Specifically, I put a few '0' characters at the beginning of a
large field, then hit '1' and let it go to autorepeat. When the
trigger fires, the insert cursor goes to a wait cursor for a
bit, then back. I'll find a few '1' characters at the beginning
of the field, and the insert cursor is now pointing the same
number of characters from the end of the field. My testing
indicates that the more time spent in the trigger, the more
likely the problem is to occur. Also, it happens more if
you're in a different form than the one with the timer.
does anyone know how to handle this situation
i m using when_timer_expired trigger with folllowing code
declare
v_timer varchar2(40);
begin
v_timer:=get_application_Property(timer_name);
if v_timer='TIMER_TIME' then
:CONTROL.onscreen:=to_char(sysdate,'HH12:mi:ss AM');
end if;
end;You could use JDAPI to make bulk changes to your Forms ...
Re: Reading items/blocks/LOVs in the Object Navigator
h2. UPDATE:
Take a look at metalink note 45615.1 - Focus And Timer Behavior In Multiple Form Applications
It seems you need to keep destroying and recreating the timer as you navigate from Form to Form ..
Edited by: Rodolfo Ferrari on Aug 20, 2009 6:26 PM -
When-Timer-Expired goes back to form
Got a problem in my application where I have a timer on my for which requery's everytime it expires. However if I am in another application e.g. Windows Nt Explorer every time the timer expires control goes back to the form.
Does any one have any ideas??Try closing Mail App in Multitask Window
1. Double tap the home button to bring up the multi-tasking view
2. Swipe up on the screenshot of the Mail app to close
3. The app will fly off the screen
4. Test Mail again -
Cursor changes to "Busy" when timers expires in Form
Forms 10.1.2.0.2
I created a Form with a multinline block to implement a blinking effect on certain rows depending on certain conditions
whilst using a repeating timer.
The screen is working fine so far but I am facing the problem that the cursor automatically changes its status from
normal to busy for a moment and then back from busy to normal when the timers expires.
In addition, the status bar on the console (which is the lower right working status bar) displays a "working"
condiition when the timers expires (scrolling from left to right each time the timer expires).
This leads to annoying visible effects as not only my rows are blinking fine but also the cursor does -.-
I removed the Synchronze; Built-In from the WHEN-TIMER-EXPIRED and also replaced any data processing within
the Trigger by a Null; Statement but the cursor keeps on changing its Form automatically.
I also tried to set the Cursor style to default within this Trigger but the cursor keeps on changing its Form.
Is there any way to suppress this behaviour ?Hi,
Do you have any security programs installed on your computer? If so, temperarily turn off them to check if this issue persists.
We can also try to run Word in safe mode to test if the issue is caused to a problematic add-in. To do this, press Windows key + R, type
Winword.exe /safe in the Run dialog and press Enter.
In addition, did you installed any printer drivers? If so, some bad printer drivers may cause such issue. Please make sure you have installed the latest printer driver form the official website. If possible, we can try to uninstall the printer drivers
to check if the issue persists.
Regards,
Steve Fan
TechNet Community Support -
Mouse enter/timer expired loses item focus
The triggers when-mouse-enter and when-timer-expired cause the current item focus to temporarily move to the module where the event was triggered if executing a multi-forms application. Also, if the user minimizes the application and he is using for example, Microsoft Excel, the cursor disappears because the focus goes to Oracle Forms due to this problem. This is irritating many users... Is there a workaround for this problem? I don't understand why this is necessary because these triggers are not interacting with any visual resource or instruction!
nullWe had a similar problem but it turned out to be caused by a sychronize command within the trigger code rather the trigger itself.
In toher words it could be what you are doing and not the trigger itself.
Regards,
Mike -
Timer expired and something unexpected occured
Hi all,
There is a timer in my forms , and there is the when-timer-expired form-level trigger.
The problem is that :
1) when I type something in a text item , then when the timer expires all the content of the text item are selected and is cleared if I did not notice it and if I continue to type.
2) when I click on a menu item and the timer expires at the same time then it is not the correct form which is called but another form.
So how to resolve these anomalies ?
Thank you very much indeed.The timer is looking for inactivity duration time :
if Win_API_Session.Timeout_get_inactive_time > name_in('global.inactivity_time') then
end if;
And there is this at the when-window-activated trigger:
hWind := get_window_property(FORMS_MDI_WINDOW,WINDOW_HANDLE);
Win_API_Session.Timeout_Start_Timer(hWind);
So what should cause the problems ? -
Menu to disappear when TIMER has expired
Hello!
I am developing a SIM Card Application!
I want to show a menu for a specific time!
I show a menu to the user, and initiate a timer at the same time. Once the timer expires, I want that menu to disappear.
Nothing happens because the phone waiting for a Menu Respons from the user!
How can i solve this problem??
Best regards.
FJWhatever you had running when the system shuts down will automatically start up again after a reboot. This is a designed behavior, so you don't have to worry about having to open everything you had running. If you have Safari running and you reboot, it'll even open up all the pages you had open.
I believe there is a way to turn this off in the System Preferences, but IMO, it's a pretty convenient feature.
Maybe you are looking for
-
I got my Mac OSX with Lion about 9 months ago. Two months after I bought it, it crashed. Apple gave no direct explanation and ended up wiping the computer. Two months after that it happended again. That time they gave me a knew hard drive but they st
-
Can I use Replacemen​t Printer ink cartridges for HP officejet Pro 8610
I recently purchased an HP OfficeJet Pro 8610. I previously had an 8600. They both use the same ink cartridges. I had just installed some remanufactured 950 XL and 951 XL cartridges in the old printer and tried to use them in the new printer. Of cour
-
I cannot download free Bollywood music from itunes
I can't download free Bollywood music from iTunes
-
Access permissions to external hard disks and media players
I've recently purchased an iMac. I have a number of external disks and media players that when connected are not allowed write access. When I use the disk utility I cannot change the permission from read only. Whats the solution to changing them to r
-
Grace period for iTunes Plus?
In the past couple of months (as recently as five days ago), I've purchased some non-Plus iTunes albums. Now, several of them are being offered as Plus upgrades to me. Is there any grace period for newly purchased items, or do I just need to swallow