Author Topic: "SuppressEADialogs" not working as expected  (Read 834 times)

fginfrance

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
"SuppressEADialogs" not working as expected
« on: October 29, 2010, 08:28:38 am »
Hi,

I am trying to manipulate the default name of the instance of a stereotyped class from a profile.

For that I use the EA_OnPostNewElement() hook to change element.Name.
To avoid the opening of the standard property dialog, I put
rep.SuppressEADialogs = True
as indicated in the help.
Now the problem is that the hook is executed after the property dialog has been shown, so I see the change appearing too late.
Is this an EA bug, do I miss something or is it a problem of my python com client? Anyone could provide a working example in C# to compare?

I add the sample code (python, but straightforward to read):
Code: [Select]
 def EA_OnPostNewElement( self, eaRep, eaInfos ):
    msgbox( 'entry' )            # here the property dialog has already been opened & closed
    rep = win32com.client.Dispatch( eaRep )  # transforms IDispatch into python object
    if rep.SuppressEADialogs:
      msgbox( 'Ea2 off' )        
    else:
      msgbox( 'Ea2 on' )                     # here MsgBox shows Ea2 on

    rep.SuppressEADialogs = True        
    if rep.SuppressEADialogs:
      msgbox( 'Ea3 off' )                    # here MsgBox shows Ea3 off, so in principle changing the variable worked
    else:
      msgbox( 'Ea3 on' )                                      
    return True

Thank you in advance,
fginfrance

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: "SuppressEADialogs" not working as expected
« Reply #1 on: April 22, 2011, 08:24:56 am »
i have exactly the same problem.
it must be a bug because it only occures if the user tries to create a stereotyped element from an own uml Profile.
then the EA Properties Dialogue is opened BEFORE the onPostNewElement() method.
if the user creates a standard non stereotyped uml element from the toolbox the EA Properties Dialogue is opened AFTER the onPostNewElement() so it can be suppressed with suppressEADialogs.
(i use .858)

qwerty

  • EA Guru
  • *****
  • Posts: 9216
  • Karma: +140/-133
  • I'm no guru at all
    • View Profile
Re: "SuppressEADialogs" not working as expected
« Reply #2 on: April 26, 2011, 04:18:00 pm »
Maybe it's connected  to this bug report.

q.

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: "SuppressEADialogs" not working as expected
« Reply #3 on: April 26, 2011, 05:45:36 pm »
it definitely is! thx for you reply

fginfrance

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: "SuppressEADialogs" not working as expected
« Reply #4 on: April 29, 2011, 05:34:19 am »
So in conclusion, there is hope  ;) - as usually is with EA
Thank you qwerty for the reply and the sparx guys for "picking" it up!

fginfrance