powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Java [игнор отключен] [закрыт для гостей] / af:document Onunload
4 сообщений из 4, страница 1 из 1
af:document Onunload
    #37693856
crazy_hands
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Возник вопрос. Как перехватить в ADF закрытие окна?
Я повесил на af:document метод Onunload, а он не работает.

Код: javascript
1.
2.
3.
<af:document id="d1" binding="#{backingBeanScope.Page.d1}"
               title="Ввод события поставки" clientComponent="true"
               unsecure="window.close;">
...
Рейтинг: 0 / 0
af:document Onunload
    #37693868
crazy_hands
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Извиняюсь, ошибся. Вот так:
Код: javascript
1.
2.
3.
<af:document id="d1" binding="#{backingBeanScope.Page.d1}"
               title="Ввод события поставки" clientComponent="true"
onunload="alert('!!!!');">
...
Рейтинг: 0 / 0
af:document Onunload
    #37693889
crazy_hands
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
И как учит оракл не пашет:
Код: javascript
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
  <af:document id="d1" binding="#{backingBeanScope.Page.d1}" clientComponent="true"
               onunload="performUnloadEvent">
<af:resource type="javascript">
  window.addEventListener('beforeunload',
                           function (){performUnloadEvent()},false)     
function performUnloadEvent(){
  //note that af:document must have clientComponent="true" set
  //for JavaScript to access the component object
  var eventSource = AdfPage.PAGE.findComponentByAbsoluteId('d1');
  //var x and y are dummy variables obviously needed to keep the page
  //alive for as long it takes to send the custom event to the server
  var x = AdfCustomEvent.queue(eventSource,
                               "handleOnUnload",
                               {args:'noargs'},false);
  //replace args:'noargs' with key:value pairs if your event needs to
  //pass arguments and values to the server side managed bean.

  var y = 0;

}
</af:resource>

<af:serverListener type="handleOnUnload"
                   method="#{backingBeanScope.Page.onUnloadHandler}"/>    



Код: java
1.
2.
3.
4.
  public void onUnloadHandler(ClientEvent clientEvent) 
  {
    System.out.println("!!!!!!!!!!!!!!!");
  }
...
Рейтинг: 0 / 0
af:document Onunload
    #37694768
crazy_hands
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Похоже в adf.rich не поддерживается.....
...
Рейтинг: 0 / 0
4 сообщений из 4, страница 1 из 1
Форумы / Java [игнор отключен] [закрыт для гостей] / af:document Onunload
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]