BudgetListener

Mike Bray (Quote Loader Author)'s Avatar

Mike Bray (Quote Loader Author)

07 Jul, 2015 09:03 AM

I wish to be notified when a new budget is added/removed so I can change a Combo Box. I have added a BudgetListener and I get notified. I then want to reload the list of budgets from the BudgetList but I am getting a:

java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source) at java.util.ArrayList$Itr.next(Unknown Source) at com.infinitekind.moneydance.model.BudgetList.notifyBudgetModified(BudgetList.java:206) at com.infinitekind.moneydance.model.AccountBook$SyncableAccounts.handleItemUpdated(AccountBook.java:1143)

I assume the notification is being fired before the change to the budgetlist has completed. How do I ensure the update has completed?

  1. 1 Posted by Mike Bray (Quot... on 07 Jul, 2015 09:36 AM

    Mike Bray (Quote Loader Author)'s Avatar

    I was getting two notifications (BudgetAdded and BudgetListModified), just responding to BudgetListModified worked.

  2. Mike Bray (Quote Loader Author) closed this discussion on 07 Jul, 2015 09:36 AM.

  3. Mike Bray (Quote Loader Author) re-opened this discussion on 07 Jul, 2015 10:04 AM

  4. 2 Posted by Mike Bray (Quot... on 07 Jul, 2015 10:05 AM

    Mike Bray (Quote Loader Author)'s Avatar

    A follow on question, does the BudgetModified method get called if a BudgetItem is added?

  5. Support Staff 3 Posted by Sean Reilly on 07 Jul, 2015 10:43 AM

    Sean Reilly's Avatar

    Hi Mike,

    Yes, it should be called if an item is added, removed, or even modified. If not, it's a bug!

    Thanks,
    Sean

  6. 4 Posted by Mike Bray (Quot... on 07 Jul, 2015 11:03 AM

    Mike Bray (Quote Loader Author)'s Avatar

    Thanks Sean, I got confused the BudgetListener seems to be a combination of BudgetList and Budget, I have added the listener to both objects and got the notification.

  7. Mike Bray (Quote Loader Author) closed this discussion on 12 Jul, 2015 09:56 AM.

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

15 Mar, 2025 03:06 AM
15 Mar, 2025 02:52 AM
15 Mar, 2025 02:31 AM
15 Mar, 2025 02:04 AM
15 Mar, 2025 12:35 AM