HomePageView.reset() never called

R. Schmid's Avatar

R. Schmid

09 Nov, 2013 03:47 AM

I've created an extension with a HomePageView. However, when I change files or open a new file, my HomePageView.reset() is never called. Instead, it only calls refresh() three times. This leaves my module showing data from the last file. When I quit Moneydance and restart the data is correct again.

What is the correct way to setup a HomePageView to get reset when data files are swapped?

  1. 1 Posted by mennesoft on 09 Nov, 2013 01:57 PM

    mennesoft's Avatar

    You need to override the handleEvent() and look for the
    AppEventManager.FILE_OPENED event.

    Note that I believe there is still a bug where the FILE_OPENED event is not
    sent to the extension when it is first installed, which is why I typically
    instruct the users to close Moneydance and reopen it after first installing
    the extension. But thereafter you should reliably get FILE_OPENED when the
    user switches a file or opens Moneydance.

    Kind regards,

    --Kevin

  2. 2 Posted by R. Schmid on 09 Nov, 2013 04:11 PM

    R. Schmid's Avatar

    Actually my mistake was constructing my objects with RootAccount members instead of pulling RootAccount from MoneydanceGUI.getCurrentAccount().

    What are the other events though? I can't find documentation on them.

  3. 3 Posted by mennesoft on 09 Nov, 2013 06:38 PM

    mennesoft's Avatar

    I've never seen documentation either, but you can look at the
    AppEventManager class and see these:

      public static final java.lang.String FILE_CLOSING = "md:file:closing";
      public static final java.lang.String FILE_CLOSED = "md:file:closed";
      public static final java.lang.String FILE_OPENING = "md:file:opening";
      public static final java.lang.String FILE_OPENED = "md:file:opened";
      public static final java.lang.String FILE_BEFORE_SAVE = "md:file:presave";
      public static final java.lang.String FILE_AFTER_SAVE = "md:file:postsave";
      public static final java.lang.String APP_EXITING = "md:app:exiting";
      public static final java.lang.String ACCOUNT_SELECTED =
    "md:account:select";
      public static final java.lang.String HOME_SELECTED = "md:account:root";
      public static final java.lang.String GRAPH_REPORT_SELECTED =
    "md:graphreport";
      public static final java.lang.String BUDGET_SELECTED = "md:viewbudget";
      public static final java.lang.String REMINDERS_SELECTED =
    "md:viewreminders";
      public static final java.lang.String LICENSE_UPDATED =
    "md:licenseupdated";

    The stuff from ACCOUNT_SELECTED and below probably don't fire, maybe they
    do. I've used APP_EXITING and above.

    Cheers,

    --Kevin

  4. System closed this discussion on 31 Mar, 2015 04:04 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

29 May, 2024 07:01 AM
29 May, 2024 06:26 AM
29 May, 2024 02:38 AM
29 May, 2024 12:43 AM
28 May, 2024 11:59 PM