OnChange Document event ?

Hi all,
Is there any way to look at any document switch in the UI.
I mean, I have 2 documents A & B.
If I swith from A to B, can I add a event handler on that switch.
It seems not to be possible in the DOM but is there any workaround ?
TIA Loic

Thanks to both of you,
I have APID but never got time to play with, that's the moment :-)
Loic

Similar Messages

  • Document events for text replacement

    Hello!
    This is a question about Document events in JTextComponent.
    Two document events in a row are fired when the user performs a text replacement (some text is selected and the user inserts or pastes new text): first, DocumentListener.removeUpdate is called for the selected text being removed; second, insertUpdate for the text being inserted or pasted.
    The question is: how can I be aware that both events are related and exist in response for the same and unique action?
    More specifically, I need to know that the remove event is part of a two-step edition in order to bypass execution flow.
    I have some bizarre ideas in mind, like proxing the original ActionMap "paste" action (for pasting) and tracking the keyboard (for inserting), but I don't think this is a too elegant approach.
    Please let me know if you would find helpful some sample code.
    Thank you!

    That's from JTextComponent replaceSelection() method source
       public void replaceSelection(String content) {
            Document doc = getDocument();
            if (doc != null) {
                    if (doc instanceof AbstractDocument) {
                        ((AbstractDocument)doc).replace(p0, p1 - p0, content,null);
                    else {
                        if (p0 != p1) {
                            doc.remove(p0, p1 - p0);
                        if (content != null && content.length() > 0) {
                            doc.insertString(p0, content, null);
    ...As you can see it calls ((AbstractDocument)doc).replace() in the most cases all the default EditorKits uses AbstractDocument extensions.
    Then from AbstractDocument's replace
        public void replace(int offset, int length, String text,
                            AttributeSet attrs) throws BadLocationException {
            DocumentFilter filter = getDocumentFilter();
                if (filter != null) {
                    filter.replace(getFilterBypass(), offset, length, text,
                                   attrs);So I think you can set your own DocumentFilter and override the filter's replace. Set the flag replaceStarted=true and call super.replace(). In the DocumentListener just check the flag.

  • Combining "allowMultipleInstances" with "OS Open Document" event = Catastrophe!

    Hey folks,
    I'm combining two somewhat "off-book" LabVIEW features here. Hoping I can get some help from the experts!
    I have an application (named APT) which has been built into an executable. In the .ini file, "allowMultipleInstances=TRUE". So calling the application more than once results in multiple instances.
    I also have the "OS Open Document" event, which triggers when the user opens .csv files from Windows Explorer.
    "OS Open Document" has been workingly splendidly for a couple months. I was recently asked to add the multiple instances case by the enduser, which I did. Now with both features, I get the following behavior:
    1) If my application is NOT the default program, then performing an "Open With --> APT" causes the file to open in Excel (?). Then APT opens, but doesn't load the file data. It acts as though it's been called without loading any file information.
    2) If my application IS the default program, then endless instances of APT begin appearing. This forces a restart.
    Has anyone had any sort of experience with combining these two features? Any ideas on how to make them play nicely together? If not, I think I may have to break it to the enduser that he can only have one or the other.
    Thanks.
    http://linkd.in/mikele

    You must be using an older version of LabVIEW. That event isn't exposed in LabVIEW 2011, as far as I know. In fact, Ton submitted an idea to provide a native way to handle this.
    Given that the event you are using isn't documented, it's anybody's guess as to what the problem is. At the very least we would need to see some code to have a chance at guessing what the problem might be. It could be something as simple as a race condition.

  • Add eventlistener to catch after save document event?

    How can I catch a after save document event?
    Best regards
    / Pontus

    http://127.0.0.1:63632/help/index.jsp?topic=%2Fcom.adobe.cside.docs%2Freferences%2Fcshalib %2Fcom%2Fadobe%2Fcshostadapter%2FIDScriptingEventAdapter.html
    Harbs

  • Validation: usage of "Complete Document" event

    Hi All.
    I'm trying to implement a Validation which checks several conditions in a Document to know if it is valid or not.
    Since these conditions are spread between the Document's lines, I choose the "Complete Document" event and expected to get a table of all lines, but it is not the case.
    I debugged the code and found that the SAP code that calls my code has a parameter called BOOL_DATA which is a table that holds the BKPF structure (of course) and also all the Document lines (stored as a table in its BSEG field).
    However, this BOOL_DATA is not used at all when my Validation is called.
    2 questions:
    1.
    How can I use this BOOL_DATA table so I can see all the Document's lines?
    2.
    If this param cannot be used, what the difference between the "Line Item" event and the "Complete Document" event in terms of what I can see and use?
    Regards.
    Ayal Telem.

    Hi Ayal Telem,
    Dear Md Faheem.
    I was not familiar with this subject.
    Thank you very much for the info.
    I started to read the documentation you referred me to and it looks interesting.
    I will update after implementation.
    Regards.
    Ayal Telem.
    That's good. Ask me anything if you struck up somewhere.
    Thanks & Regards,
    Faheem.

  • JTextField & Document Event

    Hi I need to create a GUI like a calculator with number buttons. When I press 2 if this is the first character on the text field, I should set tp "B " [B and space]. I saw many examples of DocumentFilter and Document Event using to modify the data or generate events when pressing the keys. Then I need to add special characters after few more numbers are eneterd, eg for an input is "B 34.5567" using only keys 0-9.
    Another example was to use JFormattedTextField, I posted another question on the this and got some help to use DocumentFileter.
    I am facing a problem here on how to bind the keys from the GUI to these document events. When I press the keys, I can see events are fired, but cant use it to modify the JFormattedTextField. How should I do this? I am new to JAVA Swing. I am using the examples from the net to get this done.
    Thanks for help in any advance.

    user4071312 wrote:
    Another example was to use JFormattedTextField, I posted another question on the this and got some help to use DocumentFileter.
    what did you try so far? What happened when you used the suggestions in the other thread? Show us that you are trying, that infamous small runnable ... <g>
    BTW, personally, I think it rather impolite to ask a question, get some suggestions and then simply start over again in a new thread.
    I am facing a problem here on how to bind the keys from the GUI to these document events. please get your technical vocabulary right: in the context of Swing "bind keys" is a standing term. It's unrelated to document events.
    When I press the keys, I can see events are fired, but cant use it to modify the JFormattedTextField. assuming with "events" you mean the documentEvents in a DocumentListener: you don't modify the view, you modify the model (and preferably in a DocumentFilter, as you were already advised)
    How should I do this? I am new to JAVA Swing. Boils down to a very general question: How to learn :-) First you have to learn the basics. Start simple, read tutorials, read code, try to modify what you see, experience how it works (and fails <g>)
    I am using the examples from the net to get this done. not enough - you have to understand them. Now go ahead, choose a simple starter (like the one in snoracles online tutorial) and tweak until it works like you want
    Cheers
    Jeanette

  • Capturing converting draft to real document event

    Hi all
    i wish to capture the event of turning a draft document of type warehouse transfer to a real document. in order to do so i want to capture the click event on the "Add" button in the document transfer draft form. the  problem is the draft and the real document forms have the same type. my question is how can i differntiate when i'm in a warehouse transfer draft form and not in warehouse transfer real document form?
    appreciate the help
    Yoav

    Hi, Yoav!
    The first thing i thought out is to check if there is such document in the draft-table(ODRF). When you get the Add-click event, do the query that selects from the ODRF table the document with the specific parameters - Docnum(from the 260 EditBox on the warehouse transfer form), DocDate and ObjType (67). If the record is found - it's an adding the document from the draft, if not found - it's from the real document...
    HTH!
    Aleksey Kuznetsov

  • Override event handler for document events in LiveCycle

    I would like to have an email notification when a user opens a policy-protected DRM pdf. Is there a way to override the event handler for Document Open events?
    Or perhaps there is a way to access the event database- where can I find this information?

    Thank you so much for your reply. I have created an external authorization and am following the steps outlined here: http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001479.html
    I have deployed my jar and restarted JBoss. However, now when I try to create a new policy using my external authorization, I do not see an option to add it on the create new policy page. I see only sections for Users and Groups, General Settings, Advanced Settings, and Unchangeable Advanced Settings. Could you please tell me how to add the external authorization?
    Also, in the component.xml file, I followed the sample and kept this line: <component-id>com.adobe.livecycle.samples.externalauthorization</component-id>
    Should that be changed? If so, to what?
    Thanks.

  • Photoshop save document event not firing

    I am creating a photoshop plugin using generator,'documentaftersave' event doesn't seem to working. is there anyway for me to catch save event on document.

    I am creating a photoshop plugin using generator,'documentaftersave' event doesn't seem to working. is there anyway for me to catch save event on document.

  • BeforeClose document event

    Hello,
    I'm seeing something very weird, or at least counter-intuitive with the 'beforeClose' event type.
    If I add a simple eventListener with the eventType of 'beforeClose', it seems to be dispatched twice: once before the close, and once after the close.
    #targetengine session
    app.documents[0].eventListeners.add("beforeClose", function()
         alert(app.documents[0].name);
    If there is only one document open, this will alert the document name twice.  If two or more documents are open, it will alert the document name, and then alert the second document name.
    Has anyone else experienced this?  Anyone know a workaround?  Am I being completely supid?
    /dan

    Bob,
    Thanks for your response.  Looking into this a bit more, there are, indead, two events that are fired when the document closes.  The first is an Event that targets the LayoutWindow, while the second is a DocumentEvent that targets the Document.  It was a bit counter-intuitive to me that diffrent events could trigger the same eventListener muliple times, but it seems clear now.
    Thanks,
    /dan

  • Sandbox + Document Event Handlers

    Hi,
    I am writing an sandbox Event receiver on sharepoint online. where when document will be uploaded to the document library the same document should get attached with the List item automatically.
    can anyone pin point me on how do i go about it..!?
    Thanks, Parth

    Hi,
    According to your description, my understanding is that you want to attach the document to list item when upload the document to document library.
    I suggest you use SOAP web service to achieve it.
    You need to add reference to the web service using the following URL:
    https://my.sharepoint.installation/personal/test/_vti_bin/lists.asmx
    In the web service, you can use AddAttachment funtion to add attachment to listItem.
    Here are some detailed article for your reference:
    http://msdn.microsoft.com/en-us/library/lists.lists.addattachment(v=office.12).aspx
    http://stackoverflow.com/questions/2969810/sharepoint-2010-client-object-model-add-attachment-to-listitem
    http://buyevich.blogspot.jp/2011/03/how-to-attach-files-to-list-item-using.html
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Document Event Handlers

    How do I access the Page/Open and Doc/Open event handlers using the Javascript debugger ?
    Currently, I can see only a few related to the Closing and Saving of the document...Document Will Save, Document Will Close, etc.
    There is no "Add" button in the Document Actions dialog box that appears when one clicks on Other Tasks when editing a form-based document.
    Also, I noticed there is a Javascript function "SetPageAction" which can be used for the Open event handler, but apparently this must be established via script...
    no GUI counterpart appears to be available.

    There isn't an explicit document open event. Code that you place in a document-level JavaScript will execute when the document is opened.
    To get to the Page Open/Close events, open the Pages navigation pane, select the page you want, right-click > Page Properties > Actions

  • Does "onchange" not work with form submits?

    Hello,
    I have a simple select menu that I want to behave such that if the user clicks on any menu item, the form automatically submits. So here is the snippet of code:
    <h:selectOneMenu id="allUserResidentialFeatures"
    value="#{residentialFeaturesDTO.map.allUserResidentialFeatures}"
    onchange="document.forms['myForm'].submit()">
    <f:selectItems
    value="#{utilitiesDelegate.referenceHandlesFromDTOsMap1}"/>
    </h:selectOneMenu>
    What happens is that if you click on the submit BUTTON, everything works fine: validation and the backing bean action is called, and navigation occurs.
    BUT if you click on the MENU above, the form does something I cannot understand: the fields are validated (so it is going to the back end server), but then the form is redisplayed once again - and the backing bean action is NOT called.
    Obviously the JSF lifecycle here is being short-circuited - even though I did not put "immediate='true'". But why? Isn't pressing the "submit" button and calling the "submit()" function exactly the same (ignoring the onsubmit event handler difference)?
    very confused.. a day has passed on this .. if you can help, thanks.
    -A
    Message was edited by:
    bland999

    More information on this problem that I have yet to solve: I implemented a PhaseListener to trace the application during the two submits. There is a difference that I cannot explain:
    If the form is submitted using the regular submit button (an h:commandbutton), the application transitions thru all phases normally, and during the INVOKE_ACTION phase, the beforePhase and afterPhase events sandwich the actual invocation to the backingbean action. In other words, I do see the call to the backing bean's action method.
    But if the form is submitted using the automatic "onchange" submit() from the select menu, the phases are progressed normally as before BUT the beforePhase and afterPhase events occur with NOTHING between them: the action is not invoked.
    Any idea why???
    -A
    No ideas...?
    Message was edited by:
    bland999

  • Windows 7 (64bit) & Office 2010 (32bit) Excel 'Document not saved' over WAN to network drive

    Hi All
    We are currently in the process of upgrading all PC's on our WAN to windows 7 across multiple locations
    I know this has been asked numerous times but nothing is working for me.
    We are experiencing the dreaded 'Document not saved' error at only some locations (5 or 6 out of 200 for all users, these sites generally have slow network connections) when trying to save to a network share back at our HQ. it creates a .tmp file and leaves
    the original document intact but without the changes, changing the name of the document in save as doesn't work. saving locally and copying to the share works. We can save locally and to other onsite network shares. It constantly happens so the document can
    never be saved to that network share.
    Always worked on XP SP3 with Office 2010.
    the files in question are around 4mb. smaller excel files with no contenct do work.
    I have tried literally everything listed on all forums and nothing seems to resolve it...I've tried
    - the hotfix - doesn't apply to my enviroment and the offending KB aren't installed.
    - the network resiliency, pivot table network resiliency and Enable simply copy for UNC registry keys
    - disabling offline folders, windows search and indexing
    - disabling SMB2 on the client
    - turning off QOS on the IP4 settings.
    - trusted documents.
    event log gives
    Log Name:      OAlerts
    Source:        Microsoft Office 14 Alerts
    Date:          28/03/2014 18:47:23
    Event ID:      300
    Task Category: None
    Level:         Information
    Keywords:      Classic
    User:          N/A
    Description:
    Microsoft Excel
    Document not saved.
    P1: 100490
    P2: 14.0.7015.1000
    P3: xsmh
    P4: 0x80070040
    and numerous other things.
    My guess is me the issue points to Excel loosing connection to the network share when saving and then the .tmp becoming corrupt.
    Does any one have any ideas? Is there a way to sure the connection when saving? is there a way to force it to stay connected?
    any help highly appreciated.
    Thanks

    Hello, We've been having this same issue, and I think we have a work-around.
    If we change HKLM\System\CurrentControlSet\services\LanmanWorkstation\Parameters\RequireSecuritySignature from "0" to "1" we still get the error message but the tmp file is NOT created. If the user tries to save again, it is then successful.

  • Xml file parse  event base

    hello all,
    i am learning xml file with sap help sample. I have a FM, that change xml-file into if_ixml_parser, but when i wrote the xml " <person status="retired">Walt Whitman</person>" and debug it.
    event_sub was 312, <b>event was always initial</b>.
    data: event     type ref to if_ixml_event,
            event_sub type i.
    let the parser know which events I am interested in
    event_sub = if_ixml_event=>co_event_element_pre2 +
                if_ixml_event=>co_event_element_post.
    parser->set_event_subscription( events = event_sub ).
    do.
      event = parser->parse_event( ).
      if event is initial.
        exit. ' either end reached or error (check below)
      endif.
      data: str type string.
      case event->get_type( ).
        when if_ixml_event~co_event_element_pre2.
          str = event->get_name( ).
          write: '<' str '>'.
        when if_ixml_event~co_event_text_post.
          str = event->get_value( ).
          write: str.
      endcase.
    enddo.
    Thanks for Request.
    <a href="http://help.sap.com/saphelp_nwmobile71/helpdata/de/47/b5413acdb62f70e10000000a114084/frameset.htm">sap library - Parsing an XML document event-based</a>
    Best regards
    Shuo

    Hi,
         reference link:
    http://help.sap.com/saphelp_nw04/helpdata/en/fd/9d7348389211d596a200a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/bb/576670dca511d4990b00508b6b8b11/content.htm
    Please see the PDF document which tells you how to develop with KM API's
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/aef1a890-0201-0010-6faf-8fa094808653
    Regards

Maybe you are looking for