Ajax_refresh breaks popup_editor

  

I have button with a conditional enable, and will open a pop-up window when clicked.

It works when the screen is initial loaded, but after an ajax_refresh on the button, clicking it will open the pop-up window full screen as new destination.

Version 10.0.807.0

My workaround is to use a container and ajax_refresh the container, but can only use the visible property which is not desirable.

Is this a know bug? Is there a fix?


Thanks,

Stanley

Solution

Hi Stanley.

This is not a bug.
Every time you refresh an element, its ID can change. If this happen (and it will), any JavaScript bound to this element through the ID will stop working. The PopUpEditor uses javascript bound to the element through ID to capture the click and do its "magic".

Rule: If you need to refresh a button/link to a popup. Refresh together the PopupEditor. 

Put everything inside a container is fine, but if the only problem is the visibility, put the button/link and the PopUpEditor inside an IF and the condition in the IF instead of a property. Give it a name and ajax refresh the IF instead.

Everything will work.

Cheers.

Solution

Hi Eduardo,

Thanks for the prompt reply and explanation. Refresh the PopupEditor works for me.

What I meant by visibility is the appearing and disappearing of widgets, and preferred a change of state in general.

Thanks!