PropertiesComponent not persisting? Follow
Answered
Hi,
i just want to store some small data in my plugin. I expected that when i run 1 action which saves data like this:
PropertiesComponent.getInstance().setValue("a", "testvalue");
and i run another action which reads this data with this code:
PropertiesComponent.getInstance().getValue("a");
That i get the values, but its always null.
The interesting thing is that when i do this in the storing action:
PropertiesComponent.getInstance().setValue("a", "testvalue");
PropertiesComponent.getInstance().getValue("a");
The value is as expected.
So somehow the data is not persisted anywhere, but onyl in "memory" of the action... what is wrong?
Please sign in to leave a comment.
Hi,
It should work as you expect. Please make sure you use exactly the same keys (not typos) in setting and getting values.
If the problem still exists, please provide more details about actions, context, etc. The plugin source code and test project would be perfect if possible.
Okay i finally figured this out.
The problem is the api, which works in a non intuitive way:
The correct way to use this api is: