Capture exit event
Hi All,
How can I capture the exit event from a canvas component?
I try exitState but it's not working:
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
backgroundColor="white" creationPolicy="all" exitState="checkExit()">
private function checkExit():void{
Alert.show("exit");
I try the same removed but it doesn't start the form, it shows the Alert right away.
removedFromState it doesn't work either.
Any ideas?
Thanks
Johnny
Thanks for your reply and help.
I have a menu with many options, each option will open a canvas component thru a viewStack.
When I call the component I item with viewStack.selectedItem = mycomponenIDNumber and fire the init() funciton, now when I click something else in the menu if I'm in a component I want to check something before I leave the component and fire a condition like:
Alert.show("Do you want to Save the updates?","ALERT", Alert.YES|Alert.NO, this, alertClickHandler);
Remove, removed and removeFromState doesn't fire.
Rgds
Johnny
Similar Messages
-
Unable to capture button event in pageLayout Controller
Hi Guys,
I have the following layout
pageLayout
pageLayoutCO (controller)
----header (Region)
----------messageComponentLayout (Region)
-----------------MessageLovInpurt
-----------------MessageChoice(Item)
-----------------MessageTextInput
-----------------MessageLayout
----------HideShow (Region)
-----------------MessageLovInpurt(Item)
-----------------MessageChoice(Item)
-----------------MessageTextInput(Item)
-----------MessageComponentLayout (Region)
-----------------MessageLayout
------------------------SubmitButton(ID:SearchBtn)
------------------------SubmitButton(ID:ClearBtn, fires partial action named clear)
-----------header(Region)
I am not able to capture the event fired by the button ClearBtn in the controller of the pagelayout.....
The two methods I used as follows aren't worked:
if ("clear".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
if (pageContext.getParameter("ClearBtn") != null) {
what should i do in order to capture the button event in the pageLayout Controller
Thanks in advance
Mandy
Edited by: user8898100 on 2011-8-2 上午7:49Mandy,
Its really strange that its not able to caputure the event in CO.
Below is the way in which we handle to Submit action at CO level.
/Check whether ClearBtn is same in case too.
if(pageContext.getParameter("ClearBtn")!=null){
System.out.println("Inside the Clear Btn Action");
Regards,
Gyan -
Unable to capture onClick event of htmlb:image in a controller
Hi,
I am trying to capture onClick event of an htmlb:image (which is present in my view) in DO_HANDLE_EVENT method of my controller.
Surprisingly, when I click the image, page does refreshes. But the event in not captured in do_handle_event method. Control never reaches that method. Whereas if I put onClick event of a button, it is easily captured in do_handle_event method.
Ex. code in my view is:
<%@page language="abap"%>
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:image id = "searchimg"
src = "consvalue.jpg"
onClick = "search" />
<htmlb:button id="searchbutton" onClick="search"
text="Event Test"/>
Now, the button event is captured, but not the image event.
Any idea why this might be happening?
Regards,
KaushalHi Kaushal,
are image and button enclosed by <htmlb:form> ?
Please post your of do_handle_event, where you look for the event.
Regards,
Sebastian -
How to capture the event in driver JSplitPane
Hi all, i have some problem with the JSplitPane.
What i want to do is that:
i need to capture the event throw when the user press the button in the driver of the JSplitPane, this is because i want to know wich side of the splitpane is complet visible.
Thanks for your time!
LucaI thought I would do up an example just for fun. As you drag the splitter bar the size of the two components and the splitter component is reported to the console along with the divider location. Interestinly, on my system (Windows XP, Java 1.41_02) when you move the bar downwards the divider location is consistantly two pixels past the height of the top component but when you drag the bar upwards the divider location and the height of the top component are the same.
Does anyone have any ideas why that would be?
Here is the test app:package splitPaneMonitor;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JFrame;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
public class SplitPaneFrame extends JFrame implements PropertyChangeListener {
public SplitPaneFrame() {
super ("Split pane test");
// Create the components to show in the split pane
myTopComponent = new JTextArea ("This is the top component", 10, 40);
myBottomComponent = new JTextArea ("This is the bottom component", 15, 40);
// Create the split pane
mySplitter = new JSplitPane (JSplitPane.VERTICAL_SPLIT , true, myTopComponent, myBottomComponent);
mySplitter.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, this);
getContentPane ().setLayout(new BorderLayout ());
getContentPane ().add (mySplitter, BorderLayout.CENTER);
public void propertyChange (PropertyChangeEvent evt) {
if (evt.getPropertyName () == JSplitPane.DIVIDER_LOCATION_PROPERTY) {
System.out.println ("Split pane divider moved");
Dimension size = myTopComponent.getSize ();
System.out.println (" The top component's size is: " + size.height +" h, "+ size.width + " w");
myBottomComponent.getSize (size);
System.out.println (" The bottom component's size is: " + size.height +" h, "+ size.width + " w");
mySplitter.getSize (size);
System.out.println (" The splitter's size is: " + size.height +" h, "+ size.width + " w");
System.out.println (" The splitter divider location is: " + mySplitter.getDividerLocation ());
private JTextArea myTopComponent;
private JTextArea myBottomComponent;
private JSplitPane mySplitter;
public static void main(String[] args) {
SplitPaneFrame appFrame = new SplitPaneFrame ();
appFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
appFrame.pack();
appFrame.setVisible (true);
} -
How to Capture Button event on TrainBean navigation
Hi All
i m being required to capture a button event in train bean Navigation, i m doing customization in Iexpense Module,here in Create IExpenseReport i need to capture the events of Remove,Return etc.how is it possible any clue would be very helpful.
Thanx
Prataptry this..
if (GOTO_PARAM.equals(pageContext.getParameter(EVENT_PARAM))
"NavBar".equals(pageContext.getParameter(SOURCE_PARAM))
// This condition checks whether the event is raised from Navigation bar
// and Next or Back button in navigation bar is invoked.
int target = Integer.parseInt(pageContext.getParameter(VALUE_PARAM));
// We use the parameter "value" to tell use the number of
// the page the user wants to visit.
String targetPage;
switch(target)
case 1: targetPage = "/oracle/apps/dem/employee/webui/EmpDescPG"; break;
case 2: targetPage = "/oracle/apps/dem/employee/webui/EmpAssignPG"; break;
case 3: targetPage = "/oracle/apps/dem/employee/webui/EmpReviewPG"; break;
default: throw new OAException("ICX", "FWK_TBX_T_EMP_FLOW_ERROR");
HashMap pageParams = new HashMap(2);
pageParams.put("empStep", new Integer(target));
pageContext.setForwardURL("OA.jsp?page=" + targetPage,
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
pageParams,
true, // Retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
OAWebBeanConstants.IGNORE_MESSAGES);
--Prasanna -
Not able to capture button event in pageLayout Controller
Hi Guys,
I have the following layout
pageLayout ------------------------ pageLayoutCO (controller)
----messageComponentLayout (Region)
----------messageComponentText (item)
----------messageComponentText (item)
----------messageComponentText (item)
----------messageLayout (Region)
----------------header(Region)
----------------------button (item) (say BTN1) (fires partial action)
I am not able to capture the event fired by the button BTN1 in the controller of the pagelayout..... but if i set a controller at the messageComponentLayout iam able to capture the event.
what should i do in order to capture the button event in the pageLayout Controller
Thanks in advance
Tom.Tom,
Two things:
1)The button ur using is of type submitbutton or button?.In this scenario it should be button.
2)The correct coding practice is using:
if("QUERY".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
instead of
String _event = pageContext.getParameter("event");
if("QUERY".equals(_event))
because you never know if Oracle in any upgrade or patch change the value of the constant EVENT_PARAM in class OAWebBeanConstants.
3)If first point is followed by you, just match the exact event name in code and in property inspector for the button.
--Mukul
--Mukul -
Triggering "exit" event of a drop-down list in all instances of a table row
I have a drop-down list in a table row with multiple instances that performs a calculation on the exit event. This calculation draws information from 2 other dropdown lists contained above in non-repeating rows of the same table.
The desired behavior is: should the user change their choices above, all instances of the drop-down list below would perform the "Exit" event script accessing the new values above.
My script is:
RowOptionalCoverage.DdlCoverageType.execEvent("exit"); this works, sort of
It only updates the first instance of RowOptionalCoverage and none of the subsequent instances. The user can "Tab" through the instances and trigger the Exit event for each instance, but this is not a reasonable solution.
I have tried using the resolveNodes method without success. I understand, using the resolveNodes method may be necessary when referencing multiple instances of an object:
this.resolveNodes("RowOptionalCoverage[*].DdlCoverageType[*]").execEvent("exit"); doesn't work
xfa.resolveNodes("RowOptionalCoverage[*].DdlCoverageType[*]").execEvent("exit"); doesn't work
No doubt, I must be using the resolveNodes incorrectly or missing something? Probably something simple.
Any advice is greatly appreciated.
StephenPERFECT!!! Works right out of the box!
This has opened my eyes to the essential nature of loops. My form is very large and complex and functions correctly, Yet the coding is lacking in sophistication--no loops, functions, fragments or other code efficiencies. I am teaching myself (with the help here) and I have skipped learning and using some techniques when I could things to work using the limited skill set I have.
Sometimes, I just don't "get it". After I fail a few times, I skip it and try something else. Functions are a great example. I could utilize a bunch of these if I could only write one that works. It is frustrating. If I got one to work, I know could write a ton of them. But, there is some essential part of functions I am missing that's preventing me from having my first success with them. (I think it has to do with not understanding arguments completely).
Anyway, I am overjoyed with the solution you provided and I understand it well enough to be able to use again in other situations.
Thanks again!
Stephen -
How to trigger the exit event of a subform?
hi there,
we added some code to the exit event of a subform to do some validation, but we found out that
if the user save the form after filling it and without clicking somewhere outside the subform,
the exit event will not be trigger, so the code will not check ,then the form got saved with errors.
could you pls tell us how to solve this?
br.
zjHi,
Instead of writin code in Subform just write the code in exit of the individual field.
thanks,
Amish. -
How to capture the event in ALV grid display?
Hi experts,
How to capture the event in an ALV grid display which is editable. I have to capture the TAB key or ENTER key.
regards,
Arul Jothi.Hi Arul,
Take a look at sample program BCALV_EDIT_03. (Find string "register ENTER" in the program to see how to register)
Basically you have to Register edit events using method call REGISTER_EDIT_EVENT and then write a handler method for event DATA_CHANGED..
If you are using a REUSE..GRID fm then first get the grid reference using function module GET_GLOBALS_FROM_SLVC_FULLSCR and then repeat the above procedure..
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni -
Capturing the event on clicking the af:train stop icon
We are using an af:train as follows
<fnd:applicationsPanel>
<f:facet name="appsPanelTrain">
<af:panelGroupLayout layout="horizontal" halign="center"
id="panelGroupLayout2">
<af:train value="#{controllerContext.currentViewPort.taskFlowContext.trainModel}"
id="train1"/>
</af:panelGroupLayout>
</f:facet>
</fnd:applicationsPanel>
I see the train stops on top of my page as expected. I can skip the train stops by directly clicking on the stops on top of the page.
Is there a way to capture the event of this click?This should help
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/97-deferred-trainstop-navigation-1528557.pdf -
Mouse Drag in JDialog produces Mouse Enter & Mouse Exit events in JFrame.
Hi, all.
Do I have a misconception here? When I drag the mouse in a modal JDialog, mouseEntered and mouseExited events are being delivered to JComponents in the parent JFrame that currently happens to be beneath that JDialog. I would not have expected any events to be delivered to any component not in the modal JDialog while that JDialog is displayed.
I submitted this as a bug many months ago, and have heard nothing back from Sun, nor can I find anything similar to this in BugTraq.
Here is sample code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
* This class demonstrates what I believe are TWO bugs in Mouse Event handling in Swing
* 1.1.3_1, 1.1.3_2, 1.1.3_3, and 1.4.0.
* 1) When a MODAL JDialog is being displayed, and the cursor is DRAGGED from the JDialog
* into and across the parent JFrame, Mouse Enter and Mouse Exit events are given to
* the parent JFrame and/or it's child components. It is my belief that NO such events
* should be delivered, that modal dialogs should prevent ANY user interaction with any
* component NOT in the JDialog. Am I crazy?
* You can reproduce this simply by running the main() method, then dragging the cursor
* from the JDialog into and across the JFrame.
* 2) When a MODAL JDialog is being displayed, and the cursor is DRAGGED across the JDialog,
* Mouse Enter and Mouse Exit events are given to the parent JFrame and/or it's child
* components. This is in addition to the problem described above.
* You can reproduce this by dismissing the initial JDialog displayed when the main()
* method starts up, clicking on the "Perform Action" button in the JFrame, then dragging
* the cursor around the displayed JDialog.
* The Mouse Enter and Mouse Exit events are reported via System.err.
public class DragTest
extends JFrame
public static void main(final String[] p_args)
new DragTest();
public DragTest()
super("JFrame");
WindowListener l_windowListener = new WindowAdapter() {
public void windowClosing(final WindowEvent p_evt)
DragTest.this.dispose();
public void windowClosed(final WindowEvent p_evt)
System.exit(0);
MouseListener l_mouseListener = new MouseAdapter() {
public void mouseEntered(final MouseEvent p_evt)
System.err.println(">>> Mouse Entered: " + ((Component)p_evt.getSource()).getName() );
public void mouseExited(final MouseEvent p_evt)
System.err.println(">>> Mouse Exited: " + ((Component)p_evt.getSource()).getName() );
JPanel l_panel1 = new JPanel();
l_panel1.setLayout( new BorderLayout(50,50) );
l_panel1.setName("JFrame Panel");
l_panel1.addMouseListener(l_mouseListener);
JButton l_button = null;
l_button = new JButton("JFrame North Button");
l_button.setName(l_button.getText());
l_button.addMouseListener(l_mouseListener);
l_panel1.add(l_button, BorderLayout.NORTH);
l_button = new JButton("JFrame South Button");
l_button.setName(l_button.getText());
l_button.addMouseListener(l_mouseListener);
l_panel1.add(l_button, BorderLayout.SOUTH);
l_button = new JButton("JFrame East Button");
l_button.setName(l_button.getText());
l_button.addMouseListener(l_mouseListener);
l_panel1.add(l_button, BorderLayout.EAST);
l_button = new JButton("JFrame West Button");
l_button.setName(l_button.getText());
l_button.addMouseListener(l_mouseListener);
l_panel1.add(l_button, BorderLayout.WEST);
l_button = new JButton("JFrame Center Button");
l_button.setName(l_button.getText());
l_button.addMouseListener(l_mouseListener);
l_panel1.add(l_button, BorderLayout.CENTER);
JButton l_actionButton = l_button;
Container l_contentPane = this.getContentPane();
l_contentPane.setLayout( new BorderLayout() );
l_contentPane.add(l_panel1, BorderLayout.NORTH);
JPanel l_panel2 = new JPanel();
l_panel2.setName("JDialog Panel");
l_panel2.addMouseListener(l_mouseListener);
l_panel2.setLayout( new BorderLayout(50,50) );
l_panel2.add( new JButton("JDialog North Button"), BorderLayout.NORTH );
l_panel2.add( new JButton("JDialog South Button"), BorderLayout.SOUTH );
l_panel2.add( new JButton("JDialog East Button"), BorderLayout.EAST );
l_panel2.add( new JButton("JDialog West Button"), BorderLayout.WEST );
l_panel2.add( new JButton("JDialog Center Button"), BorderLayout.CENTER );
final JDialog l_dialog = new JDialog(this, "JDialog", true);
WindowListener l_windowListener2 = new WindowAdapter() {
public void windowClosing(WindowEvent p_evt)
l_dialog.dispose();
l_dialog.addWindowListener(l_windowListener2);
l_dialog.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
l_dialog.getContentPane().add(l_panel2, BorderLayout.CENTER);
l_dialog.pack();
Action l_action = new AbstractAction() {
{ putValue(Action.NAME, "Perform Action (open dialog)"); }
public void actionPerformed(final ActionEvent p_evt)
l_dialog.setVisible(true);
l_actionButton.setAction(l_action);
this.addWindowListener(l_windowListener);
this.pack();
this.setLocation(100,100);
this.setVisible(true);
l_dialog.setVisible(true);
}(Too bad blank lines are stripped, eh?)
Thanks in advance for any insights you may be able to provide.
---MarkI guess we can think of this as one problem. When mouse dragged, JFrame also (Parent) receives events. If i understood correctly, what happens here is, Modal dialog creates its own event pump and Frame will be having its own. See the source code of Dialog's show() method. It uses an interface called Conditional to determine whether to block the events or yield it to parent pump.
Here is the Conditional code and show method code from java.awt.dialog for reference
package java.awt;
* Conditional is used by the EventDispatchThread's message pumps to
* determine if a given pump should continue to run, or should instead exit
* and yield control to the parent pump.
* @version 1.3 02/02/00
* @author David Mendenhall
interface Conditional {
boolean evaluate();
/////show method
public void show() {
if (!isModal()) {
conditionalShow();
} else {
// Set this variable before calling conditionalShow(). That
// way, if the Dialog is hidden right after being shown, we
// won't mistakenly block this thread.
keepBlocking = true;
if (conditionalShow()) {
// We have two mechanisms for blocking: 1. If we're on the
// EventDispatchThread, start a new event pump. 2. If we're
// on any other thread, call wait() on the treelock.
if (Toolkit.getEventQueue().isDispatchThread()) {
EventDispatchThread dispatchThread =
(EventDispatchThread)Thread.currentThread();
* pump events, filter out input events for
* component not belong to our modal dialog.
* we already disabled other components in native code
* but because the event is posted from a different
* thread so it's possible that there are some events
* for other component already posted in the queue
* before we decide do modal show.
dispatchThread.pumpEventsForHierarchy(new Conditional() {
public boolean evaluate() {
return keepBlocking && windowClosingException == null;
}, this);
} else {
synchronized (getTreeLock()) {
while (keepBlocking && windowClosingException == null) {
try {
getTreeLock().wait();
} catch (InterruptedException e) {
break;
if (windowClosingException != null) {
windowClosingException.fillInStackTrace();
throw windowClosingException;
}I didn't get exactly what is happening but this may help to think further -
Capturing JButton event in a JList
All,
I have a JList that renders each list item with some special formatting of a JLabel and a Jbutton. The button is an 'OK' button that must be acknowledged. When the OK button is acknowledged it should be deleted from the list model. I am having trouble capturing the event of the button. I am not interested in the list selection event per se just the selected Index, which I know how to get. Any ideas on getting to the button click event even though it is in a list?
Thanks much.I'm not sure I understand exactly what you're doing (you have a JButton inside a JList?), but to answer your last question, you get access to the button click even the same way you would with any other JButton:
JButton myListButton = new JButton("click me");
myListButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
// remove button from list or do whatever
// other processing is required -
How to track application exit event?
I have my swf embeded in Asp.Net. I want to track application exit event. Is there any event which is called when flex application exists or unload or destroyed? I tried application close event but it is not working. I do not want events of browser close or etc because I already tried it.
Thanks,
-Chanduif you wanted to just close the window all together you could write some Javascript to close the window, then in your flex app call the function when they click the logout button
If you want to actually end it with Actionscript you could try:
public function applicationExit():void {
var exitingEvent:Event = new Event(Event.EXITING, false, true);
NativeApplication.nativeApplication.dispatchEvent(exitingEvent);
if (!exitingEvent.isDefaultPrevented()) {
NativeApplication.nativeApplication.exit();
Source: http://livedocs.adobe.com/flex/3/html/help.html?content=app_launch_1.html
UKB -
On existing NWBC is there any exit event?
Hi..
I am working on web dynpro (ABAP) and i dont have knowledge on NWBC.
When we exit web dynpro portal a method WDDOEXIT() will be called which will acts as a destructor.
Is there any such kind of exiting event or a destructor in NWBC?
So please help me..
Thanks
VimalrajAdd a listener for EXITING event. AIR dispatches EXITING event on iOS when application is about to be exited. Your application can execute for around 5 seconds after receiving this event.
NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExit);
function onExit(e:Event):void
// code to be executed upon exit.
Please note that EXITING event is not dispatch if application is in suspended in background.
-Neha -
Capturing the events and performing a predefined action
I want a mechanism to capture the events:
eg: If a new document is opened , I want a text frame to be created on that document as soon as it gets opened.
what interfaces, classes can help me here? andy sample code avilable which shows how to capture events?Operating System
System Model
Windows 7 Ultimate (build 7100)
Gigabyte Technology Co., Ltd. M61PME-S2P
Enclosure Type: Desktop
Processor
Main Circuit Board
2.80 gigahertz AMD Athlon X2 240
256 kilobyte primary memory cache
1024 kilobyte secondary memory cache
64-bit ready
Multi-core (2 total)
Not hyper-threaded
Board: Gigabyte Technology Co., Ltd. M61PME-S2P
Bus Clock: 200 megahertz
BIOS: Award Software International, Inc. F2 12/30/2008
Drives
Memory Modules
320.07 Gigabytes Usable Hard Drive Capacity
125.82 Gigabytes Hard Drive Free Space
TSSTcorp CDDVDW SE-S084C USB Device [Optical drive]
SAMSUNG HD321HJ SCSI Disk Device (320.07 GB) -- drive 0, s/n S13RJ90SB04688, SMART Status: Healthy
1984 Megabytes Usable Installed Memory
Slot 'A0' has 2048 MB
Slot 'A1' is Empty
Local Drive Volumes
c: (NTFS on drive 0) *
319.97 GB
125.76 GB free
d: (NTFS on drive 0)
105 MB
65 MB free
* Operating System is installed on c:
The media files are avi and are in my videos folder (videos-windows 7)
Maybe you are looking for
-
I run windows xp, and don't have an anti-virus installed because I thought that might have been the problem. any thoughts? OS: Windows XP FireFox: 3.6.16 Plugins- * NPRuntime Script Plug-in Library for Java(TM) Deploy * Default Plug-in * Shockwave Fl
-
Messages not getting propagated?
I'm using CDC and streams - distributed async auto-log. Things have been working fine for a while. We had a DB crash due to a bad disk and I rebuilt the DB. We had a major gap in our data and getting streams to work again has been hell. I'm seeing th
-
Popup message when rolling over a form button?
Is there any way to setup a message to 'popup' when the user moves their mouse over a portal form button? I'd like to put a helpful message there while keeping the label on the button small.
-
Problems with Popup Menu on Mac
Hi, i've created an application which displays a Popup menu. i've used me.isPopupTrigger() to display the popup.it works well on windows. but when i run the same on Mac OS-X .it is not at all showing the Popup menu. is there any way i can solve this.
-
How to manage the massive storage requirements for 8.1.2 on my iPhone?
Despite having very few Apps and music on my iPhone6 I can't download the latest update, since the OS requires SO MUCH SPACE! Very frustrating...if I would have known, I would have gotten cheaper phone with more storage.