Can Event Handling work in Paint/Shape ( drawline/Rectangle)?

Hi,
I m having rectangle and line in my JPanel.
The question is, can mouseListener work on that things?
for the example, let say i click the rectangle - popup message will appear. Please help me and sample coding will help a lot
Tq

Hi ,
first understand the reply2 it is true.
you can store the information whatever you drawn on the paint method ( like ArrayList , Vecotr , HashMap , Hashtable .... into the Shape co-ordinates and locations some thing like that ) take the MouseEvent to check the mouse position which shape is involved and process it.

Similar Messages

  • HttpContext in itemDeleting Event Handler (works on itemUpdating and itemAdding)

    Hello
    How can I redirect to a custom page in the itemDeleting event handler.
    I don´t know why but the HttpContext is not available in the event handlers.
    My objective is to redirect to some page in the itemDeleting after setting the properties.Cancel = true event handlers and replace/avoid the standard sharepoint error page. For that i need the HttpContext.
    One thing curious is that the following solution works for the itemAdding and itemUpdating and I can access the HttpContext.
    Code Snippet
    public class MyEventHandler: SPItemEventReceiver
    private HttpContext current;
    public MyEventHandler() : base()
    current = HttpContext.Current;
    I hope you can help me solve this problem.
    Thanks for the help.
    Regards,
    André

    Hello all
    The following solved my problem.
    About getting the current httpcontext inside the event handler itemdeleting i have found here (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3120467&SiteID=1) a way to get it.
    In my scenario I want to cancel the event handler and redirect the user to a custom page or just avoid the sharepoint error page and return to source page.
    Code Snippet
    public override void ItemDeleting(SPItemEventProperties properties)
    base.ItemDeleting(properties);
    //event handler code
    properties.Cancel = true;
    properties.Status = SPEventReceiverStatus.CancelNoError;
    SPSite site = new SPSite(http://mysiteurl);
    SPWeb web = site.OpenWeb("mywebapplication");
    if (HttpContext.Current == null)
    HttpRequest request = new HttpRequest("", web.Url, "");
    HttpContext.Current = new HttpContext(request, new HttpResponse(new StringWriter()));
    HttpContext.Current.Items["HttpHandlerSPWeb"] = web;
    //to redirect to a custom url just replace the web.Url for a custom one
    SPUtility.Redirect(web.Url, SPRedirectFlags.UseSource, HttpContext.Current);
    Hope this helps,
    Regards,
    André Cunha
    Hello Andre,
    I am trying to add a code on Item Updating event. 
    I am unable to redirect my page to a custom Url. Please help me I tried to set values for Context object still I was unable to redirect to another page. 

  • Event handler doesn't work for a Canvas inside a canvas (Possible bug in Flex 4)

    Hi Guys,
    I have a canvas sitting inside another canvas. When i try to catch the mouseClick event in the child canvas, im not able to do it. When i change the child canvas component to a 'Panel', the event handler works perfectly fine. Any suggestions/solutions?

    ok a few things you should know... it is recomended to use the spark components when working with flash builder 4 thought the mx components are available spark is much litghter in weight. also if you want to use the equivalent of a canvas in spark then you want to use a "group" but ill warn you they dont support inline styles, a border container looked more appropiate for what you were trying to do below.  However. i did fix your code for flex 4.0
    look below.
    component:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/mx"
        creationComplete ="canvas2_creationCompleteHandler(event)">
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
      <![CDATA[
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    public function canvas1_clickHandler(event:MouseEvent):void
    Alert.show("Clicked");
    public function canvas2_creationCompleteHandler(event:Event):void
    {// TODO Auto-generated method stub//
    kenaCan.addEventListener(MouseEvent.CLICK, canvas1_clickHandler);
      ]]>
    </fx:Script> 
    <mx:Canvas id="kenaCan"
          width="400"
          height="300"
          borderStyle="solid"
          borderColor="black"
          backgroundColor="white"
          />
    </mx:Canvas>
    application:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
          xmlns:local1="local.*">
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <local1:canvas/>
    </s:Application>
    if this post answers your question please mark it as such thanks

  • OnMouseClicked event handler not working

    I'm currently playing with Netbeans 7.0 and JavaFX 2.0-beta (Java 1.6.0_26, OS Windows XP) and noticed, that the onMouseClicked event handler doesn't seem to work properly.
    I added one to the scene but it got triggered only very sporadical, when I hit the mouse button several times really fast. The onMousePressed and onMouseReleased handlers on the other side work as expected.
    I also tried adding a click event handler to other nodes like a Rectangle or a Pane but it's always the same behaviour.
    Is this a (known) bug or limitation of the beta release or am I missing something here?
    Here is a a short example:
    public void start(Stage primaryStage) {
            primaryStage.setTitle("JavaFX");
            final BorderPane root = new BorderPane();
            final Scene scene = new Scene(root, 800, 600, Color.BLACK);
            scene.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent event) {
                    System.out.println("click");
            primaryStage.setScene(scene);
            primaryStage.centerOnScreen();
            primaryStage.setVisible(true);
    }Regards,
    Kai
    Edited by: 865264 on 11.06.2011 13:29 (thanks for the tip, Darryl)

    To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.
    Don't forget to read the announcements at the top of the forum listing and the FAQ linked from every page so you'll know how to format your code correctly.

  • Javascript embedded in button pl/sql event handler not being executed

    Javascript calls not working from pl/sql button event handler. What am I missing? Are specific settings needed to execute javascript from pl/sql proceedures?
    Example: Want to toggle target='_blank' off and on in a button pl/sql event handler to open url call in new window & then reset when processing submit is done & the app returns to the form.
    portal form button's pl/sql submit handler:
    begin
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    end ;
    Putting the following in the button's javascript on_click event handler works great:
    this.form.target='_blank'
    to force opening new window with a call in the button's submit pl/sql code via:
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    but then the target='_blank' is left on when the submit is done & we return to the form.
    putting the above javascript as a function (called fcn_newpage) elsewhere (e.g., after form opens) & calling in the submit pl/sql with
    htp.p('fcn_newpage') ;
    also doesn't work.
    Metalink thought this was an application issue instead of a bug, so thought I'd see if anyone knows what's going wrong here. (Portal 9.0.4.1)

    thanks for your discussion of my post.
    Please clarify:
    "htp.p('fcn_newwindow') sends a string":
    What would you suggest the proper syntax for a function fcn_newwindow() call from a pl/sql javascript block that differs from
    htp.p('<script language="Javascript">') ;
    htp.p('fcn_newwindow');
    htp.p('</script>');
    or more simply
    htp.p('fcn_newwindow') ;
    More generally, what I'm trying to figure out is under what conditions javascript is executed, if ever, in the pl/sql of a button (either the submit or custom event handler, depending on the button).
    I've seen lots of posts asking how to do a simple htp.p('alert("THIS IS TROUBLE")') ; in a pl/sql event handler for a button on a form, but no description of how this can be done successfully.
    In addition to alerts, in my case, I'd like to call a javascript fcn from a pl/sql event handle that would pass a URL (e.g., http://www.oracle.com) where the javascript fcn executed
    window.open(URL). The API call to set_target(URL) in pl/sql has no ability to open in a new window, so calling that is inadequate to my needs and I must resort to javascript.
    Its clear in the PL/SQL of a button, you can effect form components since p_session..set_target & p_session.get_target set or get the contents of form components.
    So to see if javascript ever works, I tried to focus on something simple that only had to set what amounts to an enviromental variable when we returned to the form after a post. I chose to try to change the html value of TARGET from javascript in the PL/SQL button because it doesn't need to be implemented until we finish the post and return to the form.
    So I focused on a hack, setting this.form.TARGET='_blank' in the on_click event handler that forced every subsequent URL call or refresh of the form to be a new window. I then wanted to turn off opening new windows once I'd opened the URL call in a new window by setting TARGET='' in the portal form. I can achieve what I want by coding this.form.TARGET='' in the javascript (on_focus, on_change, or on_mousedown, ...) of every form component that might refresh the form. However, that is a ridiculous hack when a simple htp.p('<script>') ; htp.p('this.form.target=""') ; htp.p('</script>') ; at the end of the button's pl/sql event handle should do the same thing reliably if javascript ever works in the pl/sql event handler.
    If we didn't have access to form components through p_session calls, I'd assume it was a scope issue (what is available from the pl/sql event handler). But unless my syntax is just off, when, if ever, can javascript be used in a portal form's pl/sql event handler for a button?
    if I code a javascript funtion in the forms' pl/sql before displaying form:
    htp.p('<script language="JavaScript">') ;
    htp.p('function fcn_new_window(URL)') ;
    htp.p('window.open(URL)' ) ;
    htp.p('</script>') ;
    the function can be called from a button's on_click javascript event handler:
    fcn_new_window('http://www.oracle.com')
    but from the same button's pl/sql submit event handler this call doesn't work: htp.p('fcn_new_window("http://www.oracle.com")')
    So my questions remain: Is there other syntax I need, or does javascript ever work properly from the pl/sql of a form button's event handler? If it doesn't work, isn't this a bug that should be fixed by Oracle?
    I can probably figure out hacks to make things work the way I need, but executing javascript from pl/sql event handlers seems to be the expected way to affect portal html pages (forms, reports, ...) and it seems not to work as expected. I don't feel I should have to implement hacks for something as simple as calling a javascript function from pl/sql when almost every example I've found in metalink or the forums or Oracle Press's "portal bible" suggests using javascript from pl/sql via the utility htp.p() to effect web page components in portal.
    My TAR on the subject, while still open, returned the result basically: "We can reproduce your situation. Everything looks okay to us, but we can't explain how to use javascript where you want or point you to any documentation that would solve your problem or expain why it should not work the way you want it to. We don't feel its a technical issue. Why don't you post the problem on the portal applications forum."
    I'm hoping I'm just missing something fundamental and everything will work if I implement it a little differently. So if anyone sees my error, please let me know.
    by the way, not sure this is germain, but in reference to your comment:
    "redirections in pl/sql procedures give a peculiar result. in a pl/sql procedure, usually, portals give the last redirection statement and ignore anything else coming after it."
    if I try to raise an alert:
    htp.p('alert("you screwed up")');
    return;
    in a pl/sql event handler, it still doesn't raise the alert, even though its the last thing implemented in the event handler. But if I set the value of a text box using p_session..set_value_as_string() at the same spot, it correctly sets the text box value when I return to the form.

  • Event handling question

    I am very new to Swing....I am very confused about how event handling works. I created a button called "remove" and a list. When a user selects an item in the list and then clicks on the remove button, then the item should be deleted from the list. I am able to display the list and the button. I create a listener for the button in a separate class as follows:
    class MyActionListener implements ActionListener
    public void actionPerformed (ActionEvent e)
    if(e.getActionCommand().equals("remove"))
    {System.out.println("remove works");
    Now my problem is ..how do i access the list in this class..because my list is set up in the other class (main class). Because if i try to do anything with the list in this class it shows the compile time error saying it cannot identify what list is. Please tell me how i can use the list in the MyActionListener class. Here is the code that sets up the list:
    public abstract class VetNet extends JFrame implements ListSelectionListener
    static DefaultListModel listM= new DefaultListModel();
    static DefaultListModel listModel;
    public static void main (String[] args)throws IOException
    JPanel panel= new JPanel();
    JLabel j=new JLabel("Welcome");
    panel.add(j,BorderLayout.NORTH);
    BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer reader;
    reader=new StringTokenizer(stdin.readLine());
    String first_name=reader.nextToken();
    while(!first_name.equals("end"))
    { String last_name=reader.nextToken();
    add_name(first_name,last_name);
    reader=new StringTokenizer(stdin.readLine());
    first_name=reader.nextToken();
    }//while
    DefaultListModel listModel=new DefaultListModel();
    listModel=return_fname();
    String first= (String)(listModel.firstElement());
    JList sampleJList= new JList(listModel);
    sampleJList.setVisibleRowCount(2);
    // sampleJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    //sampleJList.setSelectedIndex(0);
    //sampleJList.addListSelectionListener(sampleJList);
    JScrollPane listPane=new JScrollPane(sampleJList);
    panel.setBorder(BorderFactory.createEmptyBorder(60,60,30,60));
    panel.add(listPane);
    JButton b1=new JButton("add");
    panel.add(b1);
    JButton b2=new JButton("remove");
    panel.add(b2);
    JButton b3=new JButton("edit");
    panel.add(b3);
    JFrame frame = new JFrame ("VetNet");
    frame.getContentPane().add(panel);     
    frame.addWindowListener(new WindowAdapter() {
         public void windowClosing (WindowEvent e) { System.exit(0); }
    frame.pack ();
         frame.setVisible(true);
    //MyActionListener myListener= new MyActionListener();
    b1.addActionListener(new MyActionListener());
    b2.addActionListener(new MyActionListener());
    b3.addActionListener(new MyActionListener());
    //sampleJList.addActionListener(new MyActionListener());
    }//main
    private static void add_name(String f_name, String l_name)
    listM.addElement(l_name+ ", " + f_name);
    }//method add_fname
    private static DefaultListModel return_fname()
    return listM;
    }//method return_fname

    Ok! This is the LONG answer, but I think you would benefit from reading it all.
    Making something public means that it can be accessed from other classes; however, it must be accessed using an object(instance) of that class. This means, if I have a class MyJFrame that extends JFrame, then in another class, I can do this:
    MyJFrame myFrame = new MyJFrame();
    myFrame.dispose();
    myFrame.isShowing = false;
    Given that dispose() is a public method and isShowing is a public boolean variable that's in the MyJFrame object. Note: the opposite of public is private meaning that the variable/function is only accessible within the class. Also, in all my examples, I assume each class has access to the others.(in same Package, or imported)
    There are times at which you do not want to call a function on a given object or you want variables that are defined in the CLASS context, not the OBJECT context. As in, I have the class MyJFrame, and I always want to be able to access every object(instance) of this class that I've created. I would accomplish this using a static variable. Define the variable the same place you would define any other variable of the class, but inclued the reserved word "static". As in:
    public class MyJFrame{
    public static Vector allFrames = new Vector();
    then in my contructor, I would add this frame to the vector:
    public MyFrame(){
    allFrames.add(this);
    Now that I have this set up, I can access all the frames I've made from anywhere using MyJFrame.allFrames (note that I use the CLASS name, and I don't have an instance of the object anywhere)
    Another use of static is for functions. Going along with the same example, I could add a closeAllJFrames function:
    public static void closeAllJFrames(){
    for(int x=0; x<allFrames.size(); x++){
    allFrames.elementAt(x).dispose();
    then I can call this function from any other class using: MyJFrame.closeAllJFrames();
    Also worth noting, this function could be placed in any other class(other than inner classes, which cannot have static functions), you'd just need to put MyJFrame. in front of the allFrames.
    One last tip is: If you use code like I've shown, consider using a Hashtable instead of a Vector if you need to access certain frames(or whatevers) from afar. This will keep you from iterating thru the Vector and will decrease overhead significantly.
    Hope this helps
    --Zephryl

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Repository event handler doesn't work when inserting an xml-doc via ftp

    Hi,
    I want to add a 'schemaLocation'-attribute to an XML-document when I load it in the repository. Therefore, I use the precreate-repository event and created a Repository Event Handler (see code extract below).
    Everything works fine if I type the following code in SQL Plus:
    Declare
    v_return BOOLEAN;
    Begin
    v_return:=DBMS_XDB.createresource('/public/xml/test.xml', XMLType(bfilename('XMLDIR', 'test.xml'),nls_charset_id('AL32UTF8')));
    end;Unfortunately, when I try to insert an XML-document via ftp into the /public/xml folder it doesn´t work as expected and no 'schemaLocation'-attribute is added to the new resource.
    What's the reason for this strange behavior and how can I solve it?
    For your information: I use the Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Thank you very much for your help!!!
    Repository Event Handler code extract:_
    create or replace
    PACKAGE BODY schemalocation AS
    PROCEDURE handlePreCreate (eventObject DBMS_XEVENT.XDBRepositoryEvent) AS
    XDBResourceObj DBMS_XDBRESOURCE.XDBResource;
    var XMLType;
    l_return BOOLEAN;
    l_xmldoc dbms_xmldom.DOMDocument;
    l_docelem dbms_xmldom.DOMElement;
    l_attr dbms_xmldom.DOMAttr;
    c1 clob;
    node     dbms_xmldom.DOMNode;
    txid varchar2(100);
    dDoc DBMS_XMLDOM.DOMDocument;
    nlNodeList DBMS_XMLDOM.DOMNodeList;
    BEGIN
    XDBResourceObj := DBMS_XEVENT.getResource(eventObject);
    dbms_lob.createTemporary(c1,TRUE);
    var:=DBMS_XDBRESOURCE.getcontentxml(XDBResourceObj);
    l_xmldoc := dbms_xmldom.newDOMDocument(var);
    l_docelem := DBMS_XMLDOM.getDocumentElement(l_xmldoc);
    ------ add schemaLocation attribute
    l_attr := DBMS_XMLDOM.createAttribute(l_xmldoc, 'xsi:schemaLocation');
    DBMS_XMLDOM.setValue(l_attr, 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd');
    l_attr := DBMS_XMLDOM.setAttributeNode(l_docelem, l_attr);
    DBMS_XMLDOM.WRITETOCLOB(l_xmldoc, c1);
    ------- get the value of the TxId-tag
    dDoc := DBMS_XMLDOM.NEWDOMDOCUMENT(c1);
    nlNodeList := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(dDoc, 'TxId');
    node := DBMS_XMLDOM.ITEM(nlNodeList, 0);
    txid:= dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(node));
    l_return:=DBMS_XDB.createresource('/public/ok/'||txid||'.xml', XMLType(c1));
    END;

    Marco,
    Here's an example of the problem :
    create or replace package handle_events
    as
      procedure handlePreCreate(p_event dbms_xevent.XDBRepositoryEvent);
    end;
    create or replace package body handle_events
    is
    procedure handlePreCreate (p_event dbms_xevent.XDBRepositoryEvent)
    is
      XDBResourceObj dbms_xdbresource.XDBResource;
      doc XMLType;
      res boolean;
    begin
      XDBResourceObj := dbms_xevent.getResource(p_event);
      doc := dbms_xdbresource.getContentXML(XDBResourceObj);
      select insertchildxml(
        doc
      , '/root'
      , '@xsi:schemaLocation'
      , 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd'
      , 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
      into doc
      from dual;
      res := dbms_xdb.CreateResource('/public/xml/result.xml', doc);
    end;
    end;
    declare
    res boolean;
    begin
    res := dbms_xdb.CreateFolder('/public');
    res := dbms_xdb.CreateFolder('/public/tmp');
    res := dbms_xdb.CreateFolder('/public/xml');
    end;
    declare
    res            boolean;
    resconfig      xmltype;
    my_schema      varchar2(30) := 'DEV';
    resconfig_path varchar2(300) := '/public/ResConfig.xml';
    resource_path  varchar2(300) := '/public/tmp';
    begin
      resconfig  := xmltype(
    '<ResConfig xmlns="http://xmlns.oracle.com/xdb/XDBResConfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/XDBResConfig.xsd http://xmlns.oracle.com/xdb/XDBResConfig.xsd">
      <event-listeners set-invoker="true">
        <listener>
          <description>My event handler</description>
          <schema>'||my_schema||'</schema>
          <source>HANDLE_EVENTS</source>
          <language>PL/SQL</language>
          <events>
            <Pre-Create/>
          </events>
          <pre-condition>
            <existsNode>
              <XPath>/r:Resource[r:ContentType="text/xml"]</XPath>
              <namespace>xmlns:r="http://xmlns.oracle.com/xdb/XDBResource.xsd"</namespace>
            </existsNode>
          </pre-condition>
        </listener>
      </event-listeners>
      <defaultChildConfig>
        <configuration>
          <path>'||resconfig_path||'</path>
        </configuration>
      </defaultChildConfig>
    </ResConfig>'
      res := dbms_xdb.CreateResource(resconfig_path, resconfig);
      dbms_resconfig.addResConfig(resource_path, resconfig_path, null);
    end;
    /Giving the following input XML file :
    <?xml version="1.0" encoding="utf-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>This works :
    SQL> declare
      2    res boolean;
      3  begin
      4    res := dbms_xdb.CreateResource('/public/tmp/test.xml',
      5               xmltype(bfilename('TEST_DIR','test.xml'), nls_charset_id('AL32UTF8')));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    RESULT
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
    urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd
    "/>With the same document loaded via FTP, we get :
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00283: document encoding is UTF-16-based but default input encoding is not
    Error at line 1
    no rows selectedand the content looks like :
    < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = " u t f - 8 " ? >
    < r o o t   x m l n s : x s i = " h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e " / >As a workaround, I've found that serializing and re-parsing the document solves the problem :
      select insertchildxml(
        xmltype(doc.getclobval())
      , '/root'
      , '@xsi:schemaLocation'
      , 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd'
      , 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
      into doc
      from dual;
    ...We then get the expected result after FTP transfer :
    SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
    as clob indent size = 2)  result
      2  from dual
      3  ;
    RESULT
    <?xml version="1.0" encoding="UTF-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
    urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd
    "/>The workaround also works for the DOM version presented above.
    Any ideas?

  • Can't get mouseDown event to work

    I have created some menus with rollover and click events and
    these work fine when previewed from Fireworks in a browser. However
    when I import them into Director the rollover works, but the
    onClick does not. When I look at the Lingo there is no reference to
    the onClick function. I have amended the code myself and it sort of
    works, though I am not sure how to get the correct member into the
    property.
    The code is below and the lines in bold are the one's i have
    added, any help with this would be appreciated.
    -- DESCRIPTION --
    on getBehaviorDescription me
    return \
    "ROLLOVER MEMBER CHANGE" & RETURN & RETURN & \
    "Change the sprite's cast member when the mouse rolls over
    the sprite." & RETURN & RETURN & \
    "PARAMETERS:" & RETURN & \
    "* Rollover cast member"
    end getBehaviorDescription
    on getBehaviorTooltip me
    return \
    "Use with graphic members." & RETURN & RETURN &
    "Swaps a sprite's cast member on rollover."
    end getBehaviorTooltip
    -- HISTORY --
    -- 22 October 1998, written for the D7 Behaviors Palette by
    James Newton
    -- Modified 7 January, 2000 by T. Higgins to include the
    isOKToAttach
    -- event handler along with removing some redundant error
    checking.
    -- 5 March 2000: Modified to match Fireworks button order
    -- and be D7 and D8 compatible for Fireworks Importer
    <jba>
    property spriteNum
    property mySprite
    property myStandardMember
    property myRollovermember
    property myClickMember
    on beginSprite me
    mySprite = sprite (me.spriteNum)
    myStandardMember = mySprite.member
    if myRollovermember = 0 then myRollovermember =
    member(mySprite.member.number+1)
    if myClickMember = 0 then myClickMember =
    member(mySprite.member.number+1)
    end
    on mouseEnter me
    mySprite.member = myRolloverMember
    end mouseEnter
    on mouseDown me
    mySprite.member = myClickMember
    end mouseDown
    on mouseLeave me
    mySprite.member = myStandardMember
    end mouseLeave
    on isOKToAttach (me, aSpriteType, aSpriteNum)
    case aSpriteType of
    #graphic:
    return TRUE
    #script:
    return FALSE
    end case
    end isOKToAttach
    on getPropertyDescriptionList
    if the currentSpriteNum = 0 then exit
    theMember = sprite(the currentSpriteNum).member
    theMemberNumber = theMember.number
    return \
    #myRolloverMember: \
    #comment: "Display which member on rollover?", \
    #format: #graphic, \
    #default: member (theMemberNumber + 1) \
    end getPropertyDescriptionList

    Your browser is responding to events generated by the HTML
    page. Director responds to events generated by Director. onClick is
    not a Director event, which is why you can find no documentation on
    it.
    I have never tried creating menus in Fireworks and then
    importing them into Director, so I don't know exactly what you are
    working with. If your "menus" are just a series of buttons, then
    you could try using the Mouse States behavior that you can find at
    http://nonlinear.openspark.com/tips/scripts/button/index.htm.
    This provides for rollover and mouseDown states, and also changes
    the cursor.
    You will need to add a separate behavior with an "on mouseUp"
    handler that will actually do something when the button is clicked.
    As far as modifying the Rollover Member Change behavior is
    concerned, try replacing the current getPropertyDescriptionList()
    handler with the following:

  • Validation Event Handler Not working with Flat File GTC Trusted Recon

    We are created Event Handler for checking special characters in Telephone field.Its working fine when the user is created through Admin Console.but the event handler is not triggering while doing GTC Flat File Trusted recon.
    Version: OIM 11.1.1.5.0
    Can someone please help me out with this.
    Thanks
    Edited by: 790561 on 17-Feb-2013 09:01
    Edited by: 790561 on Feb 17, 2013 9:35 PM
    Edited by: 790561 on Feb 18, 2013 12:38 AM

    Validation Event handlers will not work with your trusted recon. You can use the GTC Validation provider, it is nothing but the plugins which you can insert with in your source field in GTC. I think you can easily get the steps for how to create a custom GTC Providers.
    Edited by: iam37 on Feb 16, 2013 4:09 PM

  • I can't remove event handler functions

    Hi guys!
    Please help to remove event handler functions of a
    FLVPlaback. I add some functions for an FLVPlaback instance and
    that's why doesn't work the control panel (play button, pause
    button and so on) Here is a link:
    http://sexaid.fw.hu/vg/vg.html
    to understand simply the problem. thx every ideas!

    I would prefer not to announce the URL to the world on this forum, but I can say the old website still starts with the standard .Mac URL http://web.mac.com/username/iWeb and the new one until I set up to use my own domain was the same I believe.
    Empty the Cache has no effect I can still go to the URL and explore the various pages.
    I do not think that the .Mac websites are hosted from the iDisk location as I have defiantly deleted them from my iDisk and I have rechecked every file in the iDisk for any sign of them also my new iWeb '08 website never appeared in the iDisk. I would presume that the .Mac websites are hosted from a particular location on the Apple servers and I need to some how pull them off separately because publishing another new site with iWeb '08 has just left me with two sites and the old one remains and does not exist in iWeb '08 so I can unpublish it.

  • Event Handling for Graphic Shapes

    Hi guys,
    I have a problem on the implementation of a piece of software that i'm making, to be more specific i implement a GUI. In this GUI i draw rectangles, lines and that kind of things.
    The problem is that i want when clicking on a rectangle, an event to take place such as the drawing of something else, or a message, etc.
    How am i to achieve that? I've tried many things but didn't succeeded it unfortunately. How am i going to "give" life to my rectangles by adding event handling for them? What code should i write?
    Note: My class extends JPanel & i'm using paint(Graphics g) for drawing the shapes
    Thanks,
    John.

    Try this:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.*;
    public class Shapes extends JFrame
         DPanel pan = new DPanel();
    public Shapes()
         addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent ev)
                   dispose();
                   System.exit(0);
         setBounds(10,10,400,350); 
         setContentPane(pan);
         setVisible(true);
    public class DPanel extends JPanel implements MouseListener
         Vector shapes = new Vector();
         Shape  cs;
    public DPanel()
         addMouseListener(this);
         shapes.add(new Rectangle(20,20,100,40));
         shapes.add(new Rectangle(40,80,130,60));
         shapes.add(new Line2D.Double(20,150,200,180));
    public void paintComponent(Graphics g)
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D)g;
         for (int j=0; j < shapes.size(); j++)
              g2.draw((Shape)shapes.get(j));
         g.setColor(Color.red);
         if (cs != null) g2.draw(cs);
    public void mouseClicked(MouseEvent m) {}
    public void mouseEntered(MouseEvent m) {}
    public void mouseExited(MouseEvent m)  {}
    public void mouseReleased(MouseEvent m){}
    public void mousePressed(MouseEvent m)
         for (int j=0; j < shapes.size(); j++)
              Shape s = (Shape)shapes.get(j);
              Rectangle r = new Rectangle(m.getX()-1,m.getY()-1,2,2);
              if (s.intersects(r))
                   cs = s;
                   repaint();
    public static void main (String[] args) 
          new Shapes();
    }Noah

  • Can  DISABLE preProcess Event Handler add to the Orchestration parameters?

    I have a DISABLE pre-process event handler defined on the User object. I need to set the current date on a USR UDF attribute whenever the user is disabled or enabled or created. The CREATE handler works and the date value shows up on the user profile. However, when I try to set this attribute on the pre-process DISABLE or ENABLE event handlers, the new date does not show up. Here is the code I am using in my DISABLE/ENABLE event handler:
    Date currentTime = new Date(System.currentTimeMillis());
    orchestration.addParameter(USER_STATUS_DATETIME_ATTR_NAME, currentTime);
    Where the orchestration object is from the execute() parameter list.
    Any ideas as to why this is not working? Is adding to the orchestration not allowed for DISABLE or ENABLE event handlers? I know my handler is getting calls as I am logging the orchestration.getOperation() value.
    Thanks for any suggestions.
    -Dave
    Edited by: user552098 on Nov 12, 2012 1:56 PM

    When you update the field, make sure you are using the field label name, and not the UDF value.
    -Kevin

  • Can File Based events Handle wildcards in the filename

    The question was can file events handle wildcards in the filename? That way, the object scheduled to handle the event can query the file event specifics and process accordingly. The impact is that we will have to create a file event for every event type for every pathway/state. Therefore, in a worst case scenario, if there are 3 event types for every state, i.e., end of day, end of week, and end of month, and there are 50 pathways/states, then there would be 50 *3 or 150 total file events that would have to be entered. If BOE can handle file event wildcarding, then we need only one event.can we do that ???
    Edited by: sanfrancisco on Nov 18, 2010 5:20 PM

    Hi
    As per my knowledge events will not Handle wildcards in the filename
    Regards
    Ashwini

  • Can we apply an event handler only for a custom request in oim 11G?

    Hi,
    We would like to create a custom request for user creation, modification etc.
    I saw that event handlers allow to add business rules by running java code during differents steps of processes.
    I would like to know if we can trigger an event handler on a specific request and not on all user CREATION, UPDATE etc.
    For example, we would like to have differents creation requests and a differents event handler on each request.
    And can we add "logical" input on request form and read them in event handler?
    For example, 3 inputs: day, month and year on the form which fill one user attribute "end contract date".
    Regards,
    Pierre

    thank you Akshat,
    I saw part 19 in the developper's guide. If I understand, I can change the default CreateUserRequestData to define ALL form components that will be used in my differents user creation request templates.
    I can use prepopulation adapter to pre populate field with java code.
    I can use the plug-in point oracle.iam.request.plugins.StatusChangeEvent to run custom java code.
    But they don't mention where you can run java code for a specific creation template named "MyUserCreationTemplate1" and other java code for an other specific creation tempalate" MyUserCreationTemplate2".
    That makes me think we must retrieve the template name in java code and execute the appropriate business logic.
    if request name==MyUserCreationTemplate1
    Edited by: user1214565 on 31 mai 2011 07:42

Maybe you are looking for

  • After RAM upgrade on Satellite L30-10S only one RAM stick is recognized

    I just added an 1GB Crucial Ram stick into the L30-10S (PSL33E), but only the 1GB get recognized, the Hyundai stick (512MB), which was supplied with the laptop, isn't been used by the system anymore. I tried switch around, but I can only get 1 RAM st

  • Time Machine and Occasionally-Connected External Hard Drives

    Hi I have a MacBook Pro. It uses Time Machine to backup over the LAN, to a USB drive which is connected to my AirPort Extreme hub. This works fine. (Extremely well, in fact.) Occasionally, I do video editing work. When I'm doing this work, I connect

  • ORA-04030 error

    Database 8i OS wndows 2000 server RAM 1.5 GB SGA 1136617500 bytes getting error ORA-04030: Out of process memory when running dbms_stats.gather_schema_stats procedure. after reducing e size of sort_area_size from 40 M to 10 M above procedure has been

  • Browser interaction

    Hi there, Is it possible to instruct Edge to open a URL in the Current browser tab? I understand the "_Self" command only opens content within the same <div> and "_Blank" causes a new tab to open. The problem I am facing now is that navigation of the

  • Passcode must be reset each time return to main menu button is pressed

    I am an IT help desk professional and have come across an issue with the Iphone 4. One of our employees recently purchased one and I installed Exchange on it so she could receive business emails. She had no passcode installed on the phone, but due to