1

I am working on a plugin where I want to display a form in a popup. The form contains a text input that is configured to use the pgEmailSuggestions as its pgsrc attribute so that I can retrieve users from that input.

I use the Javascript api.PopupManager class to create a FancyPopup object. I populate this popup using its setHtml() method where the HTML comes from an Ajax request.

I have also created a global object for my plugin which has an array that I use as a cache for popups. This works all fine.

When the user clicks on the Cancel button, I want to hide the popup and the form to be reset. I have attached a listener to the click event that uses the hide() method of the popup. This works fine with a normal plain text input in the form. However, when the popup is displayed again, the rich text input, i.e. the one using pgEmailSuggestions, has not been reset.

I have even tried to clear my popup cache when the user clicks Cancel and create a new popup from a fresh Ajax request. However, the content of the text input is still the same as before the Cancel button was clicked instead of being the content from the Ajax response.

Are these fancy text input caching their content somehow? And if so, how can I clear/reset them?

flag

1 Answer

1

FancyPopups aren't using any caching beyond normal caching performed by the browser. In fact- they maintain their state unless you explicitly alter their contents.

If you need to do a hard reset of the popup's state, the simplist way to do that is to use the setHtml function to reset the internal contents of the popup.

I'm a little unclear on how you're using pgEmailSuggestions, but it seems reasonable that the underlying droplist isn't being refreshed. I'll work with you on this via Email and update this answer once we've figured it out.

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.