Author Topic: [PropertiesTab] How to get notified of changes?  (Read 6617 times)

MichPaule

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
[PropertiesTab] How to get notified of changes?
« on: January 18, 2024, 03:27:38 am »
Having created a PropertiesTab with properties configured to readonly='false' I'm wondering how one could get notified when an user changes the value of such a property.
All EA_ callbacks I tried won't be triggered upon value change.
Is there something I'm missing?
TIA for help!

Michael

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13083
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [PropertiesTab] How to get notified of changes?
« Reply #1 on: January 18, 2024, 04:40:28 pm »
The strategy for these type of things is often

- Register for the context item changed event, and remember the values you are interested in
- When a new element is selected, check the values of the previous element again to know if they have been changed.

Geert

MichPaule

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: [PropertiesTab] How to get notified of changes?
« Reply #2 on: January 18, 2024, 06:54:57 pm »
The strategy for these type of things is often

- Register for the context item changed event, and remember the values you are interested in
- When a new element is selected, check the values of the previous element again to know if they have been changed.
Hi Geert,

exactly this I did in my desperation  ;)
It works but somehow I consider it as an ugly hack and not a proper solution.
Seems I'll have to learn to live with it...
Thanks!

Michael

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13083
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [PropertiesTab] How to get notified of changes?
« Reply #3 on: January 18, 2024, 07:49:35 pm »
It works but somehow I consider it as an ugly hack and not a proper solution.
Seems I'll have to learn to live with it...

Yes, there will be lots and lots more of these hacks and workaround in your future if you keep writing automation for EA.
Better get used to it. :-X

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8561
  • Karma: +254/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: [PropertiesTab] How to get notified of changes?
« Reply #4 on: January 18, 2024, 10:18:45 pm »
It works but somehow, I consider it an ugly hack and not a proper solution.
Seems I'll have to learn to live with it...

Yes, there will be lots and lots more of these hacks and workarounds in your future if you keep writing automation for EA.
Better get used to it. :-X

Geert
Wot 'e sed!

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

MichPaule

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: [PropertiesTab] How to get notified of changes?
« Reply #5 on: March 06, 2024, 06:00:49 pm »
Update!

For unknown reason a new event EA_OnAddinPropertiesTabChanging appeared.
I'm almost sure it hadn't been there when I did my research some time ago.
Looks like I'll have to investigate on this...  ;)

Michael

MichPaule

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: [PropertiesTab] How to get notified of changes?
« Reply #6 on: March 06, 2024, 06:47:15 pm »
Looks like I'll have to investigate on this...  ;)
Success!
After slightly adapting Geerts EA-Toolpack to incorporate the new event it is working fine now on EA 16.1.1627 (64 bit).
Still wondering since when it was documented....  :-[

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13083
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [PropertiesTab] How to get notified of changes?
« Reply #7 on: March 06, 2024, 08:08:24 pm »
I found it in the documentation for 15.1, but not in the docs for 14.0

Geert

MichPaule

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: [PropertiesTab] How to get notified of changes?
« Reply #8 on: March 06, 2024, 08:41:07 pm »
I found it in the documentation for 15.1, but not in the docs for 14.0
Thanks Geert,
blame on me for not having looked more thoroughly  :-[

Michael