留言板

PermissionsURL: Preventing page refresh on save

Angeline Chan,修改在11 年前。

PermissionsURL: Preventing page refresh on save

New Member 帖子: 3 加入日期: 12-2-21 最近的帖子
I'm currently showing a permissionsURL in an AUI Dialog box, and every time I click save the whole page reloads, showing just the permissions page (since the window state is POP_UP).

Is there a way to make the permissions page not refresh?
thumbnail
jelmer kuperus,修改在11 年前。

RE: PermissionsURL: Preventing page refresh on save

Liferay Legend 帖子: 1191 加入日期: 10-3-10 最近的帖子
The window state shouldn't be POP_UP but exclusive for aui dialogs since POP_UP will include the html head, body etc tags in the output, which you do not want because aui dialogs are really just nodes in the dom of the current page.

The easiest way to solve your problem is : keep the window state POP_UP but instead of opening the url in an aui dialog, open the url in a new window (with javascript and window.open)

If you must absolutely open the dialog in an aui dialog you will need to wait until the dialog has been created and then attach a javascript event listener to the form that listenens for submits, cancels the event and executes the submit as an ajax call. When the call is dont you should refresh only the dialog content based on the response.
This is a fair bit more involved (as well as more brittle)