Call multiple URLs on single click of af:goLink in Oracle ADF

来源:互联网 发布:淘宝安装工怎样 编辑:程序博客网 时间:2024/06/06 07:09
 

Hi,

Last week i experienced a challenging task to forcefully logout from UCM when user logouts from WebCenter application without using Single Sign-on solution.

Note that the application was Extended WebCenter Spaces 11g PS2 so there was no other alternate solution for current environment. i will cover the whole topic in different post sometime soon.

In this post i will cover a simple tip how to call multiple URLs on a single click of af:goLink component in Oracle ADF.

Solution:

I created a simple JavaScript function to call a URL

 <af:resource type="javascript">    function LogoutFromUCM(){            hostname = window.location.hostname;        document.location.href="http://"+ hostname + "/cs/logout.htm";</af:resource>

Later call that JavaScript method on af:goLink using af:clientListener

 <af:goLink text="Logout"    id="logoutLink"     inlineStyle="white-space:nowrap"    rendered="#{security.authenticated}"    shortDesc="Click here to logout"    destination="/adfAuthentication?logout=true&end_url=/webcenter/faces/custom/oracle/webcenter/webcenterapp/view/templates/LogoutPage.jspx">    <af:clientListener method="LogoutFromUCM" type="mouseUp"/></af:goLink>

The destination attribute of af:goLink is callinga logout for WebCenter application and method attribute inaf:clientListener is callinga JavaScript function to perform logout from UCM.

Using similar technique you can open any URL in a popup as well.


原文:http://baigsorcl.blogspot.com/2011/08/call-multiple-urls-on-single-click-of.html?spref=tw