Book a Demo

Author Topic: Problem in TaggedValue updation.  (Read 5239 times)

Thiyagaraj A

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Problem in TaggedValue updation.
« on: May 19, 2008, 08:25:15 pm »
I have created an Add-In where in a  pop up window will be shown when an user add a new element. On that I am getting values for Tagged Values of that element. But when i update it, the TVs are not getting updated. I am showing the same dialog when an user double clicks the particular element. Surprisingly this time TVs are getting updated. Does any body had this problem before?
Regards,
Thiyagaraj A.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Problem in TaggedValue updation.
« Reply #1 on: May 19, 2008, 10:00:18 pm »
I'm not sure if I know what you mean. Perhaps you can explain further.

Are those new elements from a profile which defines tagged values? Do you mean that in the EA_OnPreNewElement event  the tagged values have not yet been added? Or in the EA_OnPostNewElement event? And in the EA_OnContextItemDoubleClicked event they are there?
« Last Edit: May 19, 2008, 10:00:58 pm by Frank_Horn »

Thiyagaraj A

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Problem in TaggedValue updation.
« Reply #2 on: May 22, 2008, 02:20:21 pm »
I am explaining further,
I have an Add-In in which on EA_OnPostNewElement handle I am showing my own dialog which takes values from the user and I am storing them as the new element's tagged values. The problem is the taggedValues are not getting updated. But I am opening the same dialog for getting the values in EA_OnContextItemDoubleClicked handle but there the tagged values are getting updated. Code for updating the taggedvalues in both the instances is the same.
Regards,
Thiyagaraj A.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Problem in TaggedValue updation.
« Reply #3 on: May 23, 2008, 04:56:38 am »
Maybe EA fires the EA_OnPostNewElement event before it adds the tagged values defined in the profile. But this doesn't seem to make sense.

What exactly are you doing?

If you call GetByName on a tagged value collection and EA has not yet added the taggeed value you want to update, it should return null. But if it actually returns a tagged value object, lets you set the Value property without throwing an exception, and then simply eats your new value without writing it to the database, then I would definitely call it a bug.

Maybe you should send a code snippet to Sparx with a bug report or a support request. Or publish a few lines of code here; maybe someone has an idea.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem in TaggedValue updation.
« Reply #4 on: May 23, 2008, 06:19:45 am »
Just a guess,

Try calling Refresh() on the TaggedValues collection of the element at some point. An un-refreshed collection sometimes acts very strangely.
No, you can't have it!