How to refresh a derma window?

Hello, I’m working on a weapons shop for my gamemode and currently have it set so that when you click on a weapon the image of a DImageButton changes to the image of the weapon you pressed, I’m going to use this as a loadout. The only problem is that the actual image doesn’t change on your screen until you close and reopen the shop. I’ve tried using panel:Refresh (panel being the name of my derma shop function) in the DoClick of the weapon but that just opens another window of the shop and gives the the lua error:
[ERROR] gamemodes/wha?/gamemode/cl_init.lua:300: attempt to index a nil value
So apparently I’m doing it wrong. If you know how to do this then please help me out.
Thanks in advance.

Post your code.

I can’t really see why I need to post my code, its just a regular derma menu attached to a DFrame. I just need to know how to refresh the shop menu so that the picture of the DImage updates when you click the button to select a different gun without having to close and reopen the menu. Anyway I’m at school right now so I don’t have access to my code at the moment.

Lol, you think someone would steal your code or make fun of you ?.
Post the damn code if Robotboy asks you to.

@Edit: Also, the easiest way to refresh DImage is just to run DImage:SetImage(‘some_other_texture.png’) again.