An event problem

Imagine this scenario: A component with an added mouseMotionListener, the mouse is pressed upon the component, dragging occurs, the component is removed, invisible, but the mousebutton is still pressed, and I would like to keep getting mouseDragged events. Not peticularly from the original component, just from some component.
How do I do that?

If I understand well, you want to drag a component and this component become invisible when you start dragging and become visible when you drop it.
I realized something like this with drag and drop.
I created MoveableLabels which have a mouse listener and a mouse motion listener added to them. Those listeners transmit each event they receive to their parent container. This container have a drag gesture recognizer that catch the forwarded events and proceed with the dnd.
I did that because when the component become invisible, no more events are created, so it is necessary to transfer the event to the parent container which one stays visible.
Here the code :
The main class :
import java.awt.*;
import javax.swing.*;
public class TestDragComponent extends JFrame {
     public TestDragComponent() {
          super("Test");
          Container c = getContentPane();
          c.setLayout(new GridLayout(1,2));
          c.add(new MoveableComponentsContainer());
          c.add(new MoveableComponentsContainer());
          pack();
          setVisible(true);
     public static void main(String[] args) {
          new TestDragComponent();
}The class for moveable labels (you can do the same thing with all kinds of components :
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class MoveableLabel extends JLabel {
     public MoveableLabel(String text) {
          super(text);
          MouseEventForwarder forwarder = new MouseEventForwarder();
          addMouseListener(forwarder);
          addMouseMotionListener(forwarder);
     final class MouseEventForwarder extends MouseInputAdapter {
          public void mousePressed(MouseEvent e) {
               Container parent = getParent();
               if (parent != null) {
                    Point newPoint = SwingUtilities.convertPoint(MoveableLabel.this, e.getPoint(), parent);
                    e.translatePoint(newPoint.x-e.getX(), newPoint.y-e.getY());
                    e.setSource(parent);
                    parent.dispatchEvent(e);
          public void mouseReleased(MouseEvent e) {
               Container parent = getParent();
               if (parent != null) {
                    Point newPoint = SwingUtilities.convertPoint(MoveableLabel.this, e.getPoint(), parent);
                    e.translatePoint(newPoint.x-e.getX(), newPoint.y-e.getY());
                    e.setSource(parent);
                    parent.dispatchEvent(e);               
          public void mouseDragged(MouseEvent e) {
               Container parent = getParent();
               if (parent != null) {
                    Point newPoint = SwingUtilities.convertPoint(MoveableLabel.this, e.getPoint(), parent);
                    e.translatePoint(newPoint.x-e.getX(), newPoint.y-e.getY());
                    e.setSource(parent);
                    parent.dispatchEvent(e);
}The class needed to transfer the comonents :
import java.awt.datatransfer.*;
import java.awt.*;
import java.util.*;
public class TransferableComponent implements Transferable {
     public static final DataFlavor COMPONENT_FLAVOR = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType, "Component");
     private Component component;
     private DataFlavor[] flavors = { COMPONENT_FLAVOR };
     * Constructs a transferrable component object for the specified component.
     public TransferableComponent(Component comp) {
          component = comp;
     public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
          if (flavor == COMPONENT_FLAVOR) {
               return component;
          else {
               throw new UnsupportedFlavorException(flavor);     
     public DataFlavor[] getTransferDataFlavors() {
          return flavors;
     public boolean isDataFlavorSupported(DataFlavor flavor) {
          return Arrays.asList(flavors).contains(flavor);
}And the last class : the container which manages dnd :
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
public class MoveableComponentsContainer extends JPanel {     
     public DragSource dragSource;
     public DropTarget dropTarget;
     public MoveableComponentsContainer() {
          setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.white, Color.gray));
          setLayout(new FlowLayout(FlowLayout.LEFT,5,5));          
          dragSource = new DragSource();
          ComponentDragSourceListener tdsl = new ComponentDragSourceListener();
          dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, new ComponentDragGestureListener(tdsl));
          ComponentDropTargetListener tdtl = new ComponentDropTargetListener();
          dropTarget = new DropTarget(this, DnDConstants.ACTION_MOVE, tdtl);
          setPreferredSize(new Dimension(400,400));
          addMoveableComponents();
     private void addMoveableComponents() {
          add(new MoveableLabel("label 1"));
          add(new MoveableLabel("label 2"));
          add(new MoveableLabel("label 3"));
          add(new MoveableLabel("label 4"));
     final class ComponentDragSourceListener implements DragSourceListener {
          public void dragDropEnd(DragSourceDropEvent dsde) {
          public void dragEnter(DragSourceDragEvent dsde)  {
               int action = dsde.getDropAction();
               if (action == DnDConstants.ACTION_MOVE) {
                    dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
               else {
                    dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
          public void dragOver(DragSourceDragEvent dsde) {
               int action = dsde.getDropAction();
               if (action == DnDConstants.ACTION_MOVE) {
                    dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
               else {
                    dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
          public void dropActionChanged(DragSourceDragEvent dsde)  {
               int action = dsde.getDropAction();
               if (action == DnDConstants.ACTION_MOVE) {
                    dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
               else {
                    dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
          public void dragExit(DragSourceEvent dse) {
             dse.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
     final class ComponentDragGestureListener implements DragGestureListener {
          ComponentDragSourceListener tdsl;
          public ComponentDragGestureListener(ComponentDragSourceListener tdsl) {
               this.tdsl = tdsl;
          public void dragGestureRecognized(DragGestureEvent dge) {
               Component comp = getComponentAt(dge.getDragOrigin());
               if (comp != null && comp != MoveableComponentsContainer.this) {
                    remove(comp);
                    dragSource.startDrag(dge, DragSource.DefaultMoveDrop , new TransferableComponent(comp), tdsl);     
                    revalidate();
                    repaint();
     final class ComponentDropTargetListener implements DropTargetListener {
          private Rectangle rect2D = new Rectangle();
          Insets insets;
          public void dragEnter(DropTargetDragEvent dtde) {
               dtde.acceptDrag(dtde.getDropAction());
          public void dragExit(DropTargetEvent dte) {
          public void dragOver(DropTargetDragEvent dtde) {
               dtde.acceptDrag(dtde.getDropAction());
          public void dropActionChanged(DropTargetDragEvent dtde) {
               dtde.acceptDrag(dtde.getDropAction());
          public void drop(DropTargetDropEvent dtde) {
               try {
                    int action = dtde.getDropAction();
                    Transferable transferable = dtde.getTransferable();
                    if (transferable.isDataFlavorSupported(TransferableComponent.COMPONENT_FLAVOR)) {
                         Component comp = (Component) transferable.getTransferData(TransferableComponent.COMPONENT_FLAVOR);
                         Point location = dtde.getLocation();
                         if (comp == null) {
                              dtde.rejectDrop();
                              dtde.dropComplete(false);
                              revalidate();
                              repaint();
                              return;                              
                         else {                         
                              int index = getComponentIndex(getComponentAt(location));
                              add(comp, index);
                              dtde.dropComplete(true);
                              revalidate();
                              repaint();
                              return;
                    else {
                         dtde.rejectDrop();
                         dtde.dropComplete(false);
                         return;               
               catch (Exception e) {     
                    System.out.println(e);
                    dtde.rejectDrop();
                    dtde.dropComplete(false);
     public int getComponentIndex(Component c) {
          Component[] comps = getComponents();
          for (int i = 0; i<comps.length; i++) {     
               if (comps[i] == c) {
                    return(i);
          return(-1);
}In this application there are two panels (left and right) containing each four moveable labels.
You can move the labels inside a same panel and from a panel to the other. The layout manager of the panels is a flow layout.
For example : if you press the mouse button over a label and start a drag, the label will become invisible. If you drag the mouse (mouse button always pressed) over another label, the dragged label will become visible and will be inserted before or after the other label (depending on the mouse position).
I hope you will find ideas with this help,
Denis

Similar Messages

  • InputField fire event problem in webDynpro

    I have one validation or Fire Event problem with respect to Inputfield in web Dynpro.
    I have one Input filed and created the context varible for that, then i mapped the context varible to the InputField, and i changed the context varible type as date.So , when i run the view , it will show the calender near to the text box to select the perticular date. On select of the perticular date. It will populate selected  date in to the inputField.
    On selection of the perticular date. Based on the date i want to generate the next 12 months date at runtime in different text boxes. But the only event available for the InputField is only "onEnter". This is not useful in my case, bcz on selection of the Date , the user may not use the Enter key. so , how can use the other events like onSelection or onChange events in the InputFields to reach my needs.
    Any one  give me the idea to solve this problem.
    Vijay

    Hello Vishal,
    You may also refer the sample code in the below link
    <a href="http://sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0c0dcacd-0401-0010-b4bd-a05a0b4d68c8">http://sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0c0dcacd-0401-0010-b4bd-a05a0b4d68c8</a>
    Regards,
    Sudeep.

  • More event problems

    Hello again, I have yet another event problem. When I try to use this code I get an error saying Abstract class actionPerformed is not implemented in non- abstract class TableWindow. I'm not quit sure how I'm supposed to implement it.

    Here is what I believe to be the relevant code. addWindowListener works but addFocusListener returns the error.
    // Table window
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class TableWindow extends Frame implements ActionListener
    public TableWindow ()
    Create Window
    super ("Test Window");
    setBackground (SystemColor.control);
    setLocation (0, 0);
    setLayout (new GridLayout (5, 5));
    addWindowListener (new WindowAdapter ()
    public void windowClosing (WindowEvent e)
    try
    if (Connected == true)
    // Close the Statement
    stmt.close ();
    // Close the connection
    con.close ();
    catch (SQLException sqle)
    dispose ();
    System.exit (0);
    tPane = new JTabbedPane ();
    tPane.addChangeListener (new ChangeListener ()
    public void stateChanged (ChangeEvent c)
    //Status.setText ("Clicked");
    tablePane = new JPanel ();
    recordPane = new JPanel ();
    recordPane.addFocusListener(new FocusListener()
    public void focusGained(FocusEvent e)
    Status.setText ("Clicked");
    queryPane = new JPanel ();
    TName1 = new TextField (25);
    TName2 = new TextField (25);
    TName3 = new TextField (25);
    idField = new TextField (10);
    idField2 = new TextField (10);
    TitleField = new TextField (25);
    TitleField2 = new TextField (25);
    result = new TextArea ("Under Construction", 5, 30);
    NewT = new Button ("New Table");
    NewR = new Button ("New Record");
    NewQ = new Button ("New Query");
    NewT.addActionListener (this);
    NewR.addActionListener (this);
    NewQ.addActionListener (this);
    TNameLabel1 = new Label ("Enter name of table here");
    TNameLabel2 = new Label ("Enter name of table here");
    TNameLabel3 = new Label ("Enter name of table here");
    idLabel = new Label ("Enter movie ID here");
    TitleLabel = new Label ("Enter title of Movie here");
    TitleLabel2 = new Label ("Enter title of Movie here");
    tablePane.add (TNameLabel1);
    tablePane.add (TName1);
    tablePane.add (NewT);
    recordPane.add (TNameLabel2);
    recordPane.add (TName2);
    recordPane.add (idLabel);
    recordPane.add (idField);
    recordPane.add (TitleLabel);
    recordPane.add (TitleField);
    recordPane.add (NewR);
    //recordPane.add (tableChoice);
    queryPane.add (TNameLabel3);
    queryPane.add (TName3);
    queryPane.add (TitleLabel2);
    queryPane.add (TitleField2);
    queryPane.add (NewQ);
    queryPane.add (result);
    Status = new Label ("");
    // make the window and add components to it
    tPane.addTab ("Table", tablePane);
    tPane.addTab ("Record", recordPane);
    tPane.addTab ("Query", queryPane);
    add (tPane, BorderLayout.CENTER);
    add (Status, BorderLayout.SOUTH);
    pack ();
    setVisible (true);
    public static void main (String args [])
    ConnectToDatabase ("vdds");
    TableWindow tw = new TableWindow ();
    }

  • Events problem with (Java and ActiveX)

    Hi,
    I use an ActiveX component with Java and i've got a problem with events.
    Java classes were generated with Bridge2Java (IBM).
    In order to manage events I added a listener in my application :
         javaMyActiveX = new MyActiveX();
         javaMyActiveX.add_DMyActiveXEventsListener(new _DMyActiveXEventsAdapter());
    I also added a constructor in the _DMyActiveXEventsAdapter class and I fill the body of methods.
    The ActiveX generates two types of events :
    - The ones are directly generated by methods.
    - The others are generated by a thread.
    With MS Products (VB, Visual C++, Visual J++), I catch all events.
    With java (jdk 1.4), I catch only events generated by methods.
    Can anyone help me.

    I'm not 100% sure, but the last time I used that bridge, it only worked if you ran your Java app within a Microsoft VM.

  • Help needed with Image Events problem

    Hi there I'm writing what I thought was a simple script to convert a folder full of images from jpg to tiff. But the script fails when trying to convert the first image in the folder. Instead of converting the image, Preview opens with the image shown and I get this error message: error "The variable ImageRef is not defined." number -2753 from "ImageRef".
    I have seen some posts about other people having the same problem, but I haven't seen any solutions.
    Here's the script.
    on run
    tell application "Finder"
    set PicturesFolder to ((path to home folder) as string) & "Pictures:SenseCam" as alias
    set Photographs to (get entire contents of PicturesFolder) as alias list
    end tell
    tell application "Image Events"
    launch
    repeat with Photo in Photographs
    if (Photo as string) ends with "jpg" then
    set ImageRef to open Photo
    save ImageRef in Photographs as TIFF
    close ImageRef
    end if
    end repeat
    end tell
    tell application "Finder"
    repeat with Photo in Photographs
    delete Photo
    end repeat
    end tell
    end run
    Thanks in advance for any help.
    John

    Hello
    You may try something like the modified code below.
    Noticiable changes :
    #1 - Removed the parentheses. Your original code won't yield alias list but a list of finder objects, which is the reason why Preview opens the image. (The statment 'open finderObject' behaves the same as double clicking it in Finder)
    #2 - Only delete the original jpeg files which are converted to tiff.
    #3 - Build new path for converted image.
    #4 - Save in new path. (When saving image in a format other than its original format, always save the image to a new file and do not attempt to overwrite the source file.)
    cf.
    http://www.macosxautomation.com/applescript/imageevents/08.html
    on run
    tell application "Finder"
    set PicturesFolder to (path to home folder as string) & "Pictures:SenseCam:" as alias
    set Photographs to get entire contents of PicturesFolder as alias list -- #1
    end tell
    set DonePhotos to {} -- #2
    tell application "Image Events"
    launch
    repeat with Photo in Photographs
    set Photo to Photo's contents
    set oldPath to Photo as string
    if oldPath ends with ".jpg" then
    set newPath to oldPath's text 1 thru -5 & ".tif" -- #3
    set ImageRef to open Photo
    save ImageRef as TIFF in newPath -- #4
    close ImageRef
    set end of DonePhotos to Photo -- #2
    end if
    end repeat
    end tell
    tell application "Finder"
    delete DonePhotos -- #2
    end tell
    end run
    Hope this may help,
    H

  • ICal all-day event problem

    iCal on my iPad worked fine for a while. Now, many of my all day events (but not all of them) are showing up a day early on my iPad on week view. Everything is fine on all other devices (iPhone, MacBook) and all is fine on iPad on day, month and list view. All timed events are in the right place. But all day events in week view are a disaster and turning off the iPad isn't helping. Any advice?

    Did you travel out of your home time zone and first notice the problem then? I spent an hour and a half on the phone with Apple Care while I was in the Central zone (I live in Eastern) and nothing the supervisor suggested worked (deleting the account, resetting, turning ipad off, etc). They'd bumped me up to a supervisor because the regular guy had no idea. Supervisor said no one on the internal tech board had seen that particular problem. The final assumption was it was a software glitch on my ipad--the advice was a complete restore which was going to have to wait until I returned home because he said it would take too long over the Verizon mi-fi I was using while traveling. Anyway--I got home to Eastern time, immediately pulled out the ipad to do the restore and all the all-day events were in the right place and have remained in the right place since then. My best guess is that it's a time zone issue but it doesn't make much sense. All my timed events stayed right where they were supposed to be the whole time (time zone support turned off).

  • Creation of an event : problem with the container

    Hi Gurus,
    I'm facing a problem in creation of an event.
    I'm in SAP ECC 6.0 for a migration project from 4.6B
    In an ABAP program I'm trying to create an event in order to launch a workflow.
    1st step : Set datas in the container -> In INTERNAL_TABLE I have 5 lines.
    swc_set_table event_container 'INTERNAL_TABLE' t_cnp_container.
    2nd step : Create an event :
      CALL FUNCTION 'SWE_EVENT_CREATE'
              EXPORTING
                objtype              = w_wf_objtype
                objkey               = w_wf_objkey
                event                = w_wf_event
                creator              = applicant
                start_recfb_synchron = 'X'
              TABLES
                event_container      = event_container
              EXCEPTIONS
                objtype_not_found    = 1
                OTHERS               = 2.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              WRITE sy-subrc.
            ENDIF.
    Now when I check my container with SWI2_FREQ I see that INTERNAL_TABLE has just one ligne, the rest disapears.
    I have this problem only when I set an internal table in an container
    I don't know why, but it perfectly works on 4.6B.
    Thanks a lot
    Walid

    Hi,
    I dont see a point in having this statement
    swc_set_table event_container 'INTERNAL_TABLE' t_cnp_container. Infact it is not needed !!
    SWE_EVENT_CREATE like any other FM, take a
    lt_var type standard table of SWCONT.
    ls_var type SWCONT.
    fill your ls_var with all fields and append it to lt_var each time and pass lt_var to event_table of SWE_EVENT_CREATE. It should work !!
    However, suggested way is to use SAP_WAPI_CREATE_EVENT instead of SWE_EVENT_CREATE  from ECC 5.0 onwards. There are fe concerns with SWE_EVENT_CREATE mainly with respect to commit and persistancy. Better we should use SAP_WAPI* as much as possible from ECC 5.0.
    Try above and Good Luck !!
    Regards
    Krishna Mohan

  • Mac OS / classpath / custom event problem

    I'm having a bit of trouble with a particular classpath
    anomaly, and I have a feeling that it might be a Mac thing.
    Not sure if anyone else can reproduce this, but I managed to
    make a custom event and a class that extends the EventDispatcher
    once. Since then, Flash has refused to admit that any class
    associated with a custom event exists - mostly producing the error
    1046. Even after you take out any references to the event
    dispatcher or a custom event, the class is ignored.
    All my classes are kept in a single 'Packages' folder with
    sub folders that I include in the import statement (I've
    triple-checked the classpath settings, the import statements, and
    the classes themselves - I have probably a hundred or so other
    classes that are fine, and all referenced in the same way, some
    that extend EventDispatcher, some that don't.
    I come across this a few times now - once I was able to fix
    it by putting the .as file in the same folder as my first custom
    event, but this no longer works.
    I'm running Mac OS X 4.11 on two computers - both have the
    same trouble.
    I've tried copying the classes to other folders and changing
    the package/import path accordingly - no go.
    Even stranger, if you copy and paste to a new .as file, and a
    different package folder, the problem persists in that Flash claims
    the revised Package statement (to reflect the new location) does
    not reflect the position of the file - when it clearly does.
    I haven't had this problem with any other home-grown class -
    only those that reference a custom event.
    It sounds like it should be pilot error, and I've spent a
    long time trying to spot a silly mistake. But as this problem has
    recurred a few times now, I'm beginning to think it isn't me.
    Anybody else experience similar classpath problems with AS3
    on a Mac? Anybody have any suggestions?

    I am also a newbie and my answer could be wrong.
    But from the looks of it, You are Unable to load performance pack.
    The solution is "Please ensure that libmuxer library is in :'.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    I hope BEA or someone can tell you the file name of libmuxer. And make sure it is in the Folder where the script is searching/looking.
    Good luck.
    fred

  • ABAP OO Event Problem

    Hi,
    I read the blog posted by Jocelyn Dart-<b><i>Raising ABAP OO Events for Workflow</i></b>...
    <b>/people/jocelyn.dart/blog/2006/07/27/raising-abap-oo-events-for-workflow
    When I tried the same using my own Class, I am getting some problem.
    Well, I created my Class with two Attributes
    1) <i>M_POR</i>(Persistent Object Reference Attribute)
    2) <i>PERNR</i>(Employee Number)
    And I created a Constructor with one parameter.
    And I also coded the remaining standard methods as per that blog - <b><i>USING ABAP OO Methods in Workflow Tasks</i></b>.
    Finally I activated my CLASS and each individual method.
    I created one small report that raises ABAP OO Event as mentioned in the blog with the below mentioned code.
    <i>report  yworkflowtrigger_ooabap.
    data : ls_ywftest1_key type p_pernr,
           lv_objtype type sibftypeid,
           lv_event   type sibfevent,
           lv_objkey  type sibfinstid,
           lr_event_parameters type ref to if_swf_ifs_parameter_container,
           lv_param_name       type swfdname,
           lv_visit_date       type datum.
      lv_objtype = 'YWFTEST1'.
      lv_event = 'STARTEVENT'.
    Set up the LPOR Instance id
      ls_ywftest1_key = '00000024'.
      move ls_ywftest1_key to lv_objkey.
      try.
        call method cl_swf_evt_event=>raise
          exporting
            im_objcateg        = cl_swf_evt_event=>mc_objcateg_cl
            im_objtype         = lv_objtype
            im_event           = lv_event
            im_objkey          = lv_objkey
           IM_EVENT_CONTAINER =
         catch cx_swf_evt_invalid_objtype .
         catch cx_swf_evt_invalid_event .
      endtry.</i>
    I switched on my event trace and tried raising the Event. But event is not raised even after execution of this code. I checked the SY-SUBRC value at the ENDTRY, But this seems perfect(SY-SUBRC = 0).
    Why is my event not getting triggered even after the execution of above code?
    Is there anything which I have missed.
    We are on <b>ECC 5.0</b>
    Regards,
    <i><b>Raja Sekhar</b></i>

    I missed this tip in that blog.
    "<i><b>Tip! Just as for Business Object events, the COMMIT WORK statement is crucial when raising a Workflow event - without this the event will not be raised.</b></i>"
    Regards,
    <i><b>Raja Sekhar</b></i>

  • Client Eventing Problem with URL Iview

    Hi,
    I am new to EP and have a basic client eventing question. We are trying to integrate a URL Iview from a partner product with a standard Iview downloaded from Iviewstudio. This standard Iview is capable of handling client events from other Iviews in the standard package. We want to re-use this Iview with the same event (same functionality) to be able to handle events from the partner URL Iview.
    The partner Iview and our portal are on different servers.
    We are using the following Javascript but it doesnt seem to raise the event.
    EPCM.storeClientData('urn:com.sap.bor:BUS0010','objid',LocId));
    EPCM.storeClientData('urn:com.sap.bor:BUS0010','AllKeys','objid');
    EPCM.raiseEvent('urn:com.sap.bor:BUS0010','select','','/irj/servlet/prt/portal/prtroot/...'
    We were able to debug and find that the data was being stored in the Data Bag. However the event is not being raised at all. It seems that it just gets stuck somewhere in the Raise event. We even put a javascript alert after the raise event but it doesnt seem to reach there at all.
    Could you give me a few pointers as to what the problem might be.
    Thanks in advance.
    Message was edited by: Mayank Bhatnagar

    Hi,
    let's have a look at two quotes of the PDK documentation.
    "Using the EPCF from your JavaScript, you can send messages to JavaScript code embedded in other iViews."
    "Isolated iViews are iViews that are not inlined into a portal page, but referenced using an IFRAME. To make the EPCF available in such iViews, the EPCF JavaScript as well as the EPCF applet are included into each generated frame."
    From my point of view, this only can work automatically with content provided by the portal.
    Therefore, this can't work with isolated URL iViews  generated with the wizards. Imagine a google iView, running in an iFrame. Google is called by the portal, but it's simply standard google HTML output - displayed in the portal.
    To provide the capability of the EPCF, the epcf javascript file has to be included in the "partner URL iView"'s source. I tried this and it worked. However, this is not a highly sophisticated solution
    If the partner iView's server is running in a different domain, there are further issues to be considered (keyword: java script origin policy)
    If anybody has corrections or can provide a good solution, don't hesitate.

  • KeyReleased event problems

    Hi everybody,
    i have a JTable and what I want to is that when the user type something in the TextField the table will show the names of the company that start with the letter that the user typed. But the problem is that each time the user type the event executes 2 times, this is the code:
    private void txt_searchCompanyKeyReleased(java.awt.event.KeyEvent evt) {
    TableModel model = jt_Company.getModel();
    ArrayList<String[]> dataArray = new ArrayList<String[]>();
    String[] data = new String[ jt_Company.getRowCount() ];
    String s = txt_searchCompany.getText();
    System.out.println("Cantidad de filas: " + jt_Company.getRowCount()+ "\nCantidad de col: " + jt_Company.getColumnCount());
    for(int i = 0; i < jt_Company.getRowCount(); i++)
       for(int j = 0; j < model.getColumnCount(); j++)
           if(model.getValueAt(i, 1).toString().startsWith(s) == true)
             data = model.getValueAt(i, j).toString();
             dataArray.add(data);
              System.out.println(" " + data[0] + "Tamano de ArrayList: " + data.  length);
    jt_Company.setModel(new Business.CompanyTable(dataArray));
    }//End of the method
    the method compares very well the string and the name of the companies in each row, but as mention before the method do it 2 times that means that the string array will the double of rows.
    How can I do to make the event execute only one time
    Thanks a lot.......

    Hi,
    KeyListener is not probably a good idea for you. You should use DocumentListener. for Example:
    jTextFieldIP.getDocument().addDocumentListener(new DocumentListener()
       public void changeUpdate(DocumentEvent e){}
       public void insertUpdate(DocumentEvent e)
           try
               jListCode.setSelectedIndex(Integer.parseInt(jTextFieldIP.getText()));
            catch(NumberFormatException ne)
                JOptionPane.showMessageDialog(null, "Only numbers in this field please.");
       public void removeUpdate(DocumentEvent e)
           insertUpdate(e);
    } );

  • Labview event problem

    Hi guys
    I have a problem with the event case. I have a Button called "CON". This Button have to start two deferent Event Structurs by change his value, but not on the same time.
    Between the Event Structurs i have two Case structurs with other stuff. Wehn i first press the button, it will be make the stuff twice (like i press the button twice). I have no idea why.
    thanks for Help

    Because each event structure has its own event queue.  So when you press the button, all event structures that are registered for that value change event will have it queued up.  So your first event structure sees the event and runs that event case.  The second event structure can't run yet due to data flow, but it has the event queued up.  So when that second event structure is reached, it can run that event case.
    In general, your VI should only have 1 event structure.  This makes handling events A LOT simpler.  Look into the state machine.  That will help you handle your events properly and in a central location.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Non Tempo-Event problem

    Hi,
    I keep getting a "Non Tempo-Event Found in Sync Reference" alert, every time I try to do a tempo change, and the "Unable to sync audio and midi" afterwards.
    I am only using external midi in sync with a quicktime movie (without audio). No other audio in the project.
    (Btw. does anyone know how to turn of the vertical mouse-zoom that happens when you try to navigate in the timeline?)
    Mac pro 3 OS 10.5.2
    FW 1884 audio/midi interface
    Xiste

    I found that in my tempo list, there was an odd event that I didn't place there, and I think that was what was causing this error message although, now my MIDI is extremely delayed, to the point where it is unplayable when composing.
    The playback is fine, but anything I play live is really delayed, and it is only in this song! It reminds me of the problems people had when trying to import some Logic 7 songs and getting delayed MIDI. It is the smae problem here, but this is a song composed entirely in L8.
    Any ideas to this new delay problem? The MIDI was fine at the beginning of this composition...

  • KDE4 "When lid closed" event problem

    Hi,
    i'm using updated Arch Linux system with KDE4. My problem is, that KDE Power Manager does not hear on lid close event. I can choose everything from menu (suspend, lock screen, ...) but it does nothing. After closing the lid, system follows "Do nothing" option.
    Few weeks ago, everything was fine - closing the lid raised sleep action.
    Last week i set up "Do nothing" option for lid close event and today i'm not capable to return sleep option back.
    I can sleep computer from menu or with 'systemd sleep' command. I have everything commented out in /etc/systemd/logind.conf.
    Thank you for help.
    j.
    EDIT: I have another problem. When I turn off AC adapter, status icon of batery does not change. My notebook thiks, that is still on-line on AC. Something is wrong and i'm afraid that is HW issue.
    EDIT: I have found some warnings in dmesg. What does it mean?
    [ 8.891349] ACPI: Battery Slot [BAT1] (battery present)
    [ 8.896149] ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 1 (20130725/utaddress-251)
    [ 8.896157] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
    [ 8.896161] ACPI Warning: 0x0000000000000530-0x000000000000053f SystemIO conflicts with Region \GPIO 1 (20130725/utaddress-251)
    [ 8.896165] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
    [ 8.896166] ACPI Warning: 0x0000000000000500-0x000000000000052f SystemIO conflicts with Region \GPIO 1 (20130725/utaddress-251)
    [ 8.896169] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
    Last edited by juray (2014-01-31 09:16:05)

    OK, I am victim of this BUG
    https://bugzilla.kernel.org/show_bug.cgi?id=44161
    Don't buy Samsung ultrabooks. They seems to be only Win8 compatible

  • EVENT problem in Table maintenance generator

    Hello all
                 I m working on 4.6C sytem. I m facing  2 problems in events in table maintenance generator
    (1) I am using 04 event (After deleting records from table)   I have written BREAK-POINT in the Form .....ENDFORM... But the control doesnt stop there , when i select  an existing record and press delete record button? not able to understand  this
    (2) When i implement even t 03( Before deleting records from table) , and select  an existing record and press delete record button . Control successfully Go  to corresponding FORM ...   BREAK-POINT ENDFORM . 
    But now the problem is.. in debuggin i can see the contents in TOTAL table  but when i try to code LOOP at TOTAL ..ENDLOOP...it gives me syntax error saying "  table TOTAL doesnot exists or not defined..but similar field TOTAL_S , TOTAL_M , TOTAL_L  exists.. ???
      how come i can see the same during debugging but cannot code it ?
    Plese help
    Nilesh

    Hi Nilesh,
    (1)  I think the control will stop there after you delete AND save. Not sure about that but give it a try.
    (2) I believe you are trying to access fields inside table TOTAL, is that right?
    Actually you have to declare a work area with your Z table type.
    DATA: w_workarea type ztable.
    LOOP at total.
      w_workarea = total.
    endoop.
    Then you can work with w_workarea.
    Best regards.

  • KeyboardEvent.KEY_DOWN event problem

    Hi, I have create a game and added keydown event on Stage but but problem is user need to click on stage then it start capturing keydown event. I want that when game window open after that user don't need to click on flash stage area for unable keydown event..

    See if adding:  stage.focus = this;   helps.

Maybe you are looking for