Disable the Back Button in browser

Reuirment-To Disable the Browser Back Button you need to use java script code in your jsp page.

For example, You have Page 1 and Page 2 .And you are navigation from page1 to page 2.now you click on browser bck button.
We need to disable this thing.We will be writing a javascript code into the page 1.We will use forward method.Let check what does it do-

forward()– method loads the next URL in the history list.This is the same as clicking the Forward button in the browser.JavaScript window history forward method provides the functionality to navigate the user to the next page visited by him. Actually history forward method works only if the user navigates to the previous page using back button of browser of history back method provided by JavaScript. This back history navigation enables the forward history navigation. JavaScript History object belongs to JavaScript window object that allows you to access the forward method using window.history.forward. You can also access the forward method directly as history.forward.

<script type ="text/javascript">
function stopGoingBack()
{
window.history.forward();
}
</script>
<html>
    <head>
    <title> Using the forward method of the History object</title>
    </head>
    <body>
    <form name=form1>
    Click on the button to go to the forward browser page.
    <input type="button" value="Go Forward" onload='stopGoingBack()'>
    </form>
    </body>
    </html>

Call this method on onload on the body of page.

Happy coding with techartifact with Vinay . 🙂

Adding Porlet into Webcenter Application

If you have portlets based on JSR 168 or JSR 286 and you want to add in webcenter 11g application.Oracle WebCenter Framework enables you to consume a portlet by registering its producer either with an application or with the Resource Palette from where you can add it to any application. After you register the producer, its portlets appear under the registered producer’s name under the Connections node in the Application Resources panel or in the Resource Palette.

For this you need to register WSRP portlet producer .If porlets JSR 168 is WSRP 2.0 enabled then it can be usable in webcenter 11g.

Register a WSRP portlet producer:

-> In the Application Resources panel of the Application Navigator, right-click Connections, choose New Connection and then choose WSRP Producer.
-> Use the Register WSRP Portlet Producer wizard , provide information and register .

Adding Portlets to a Page

Placing a portlet on a WebCenter Portal application page is a simple matter of dragging the portlet from the Application Resources panel or Resource Palette and dropping it on the page.
In the Application Navigator, open the application that contains the page (.jspx file) to which you want to add the portlet.
Under the Connections node in the Application Resources panel of the Application Navigator, or in the Resource Palette:
If the producer is a WSRP producer, expand the WSRP Producer node.
If the producer is a PDK-Java producer, expand the Oracle PDK-Java Producer node.

Expand the node for the portlet producer that contains the portlet to add to the page.Under the selected producer, all portlets contained by that producer are listed.
Drag the portlet from the producer node directly onto the page.You should drag the portlet onto a form on the page.

When you add a portlet to a page, a portlet tag (adfp:portlet or adfph:portlet) is added to the page source. This is the tag that represents the portlet component. This tag includes attributes that you can edit using the Property Inspector, or in the page source, to further control the behavior and appearance of the portlet.

The type of portlet tag used is determined by the following:

->If the project is configured for rich client components alone, the adfp:portlet tag is used.
->If the project is configured for Trinidad components alone, the adfph:portlet tag is used.

  <adfp:portlet value="#{bindings.FooterPortlet1_3}"
                            portletType="/oracle/adf/portlet/SamplePortlets_1257247466260/ap/E2default_ba133935_0124_1000_8008_0a093208e9fc"
                            id="portlet18" binding="#{backing_home.portlet18}"
                            displayHeader="false" width="100%"
                            renderPortletInIFrame="false"
                            displayScrollBar="false"/>


You can add the attributes by changing the source code or using property Inspector .

Executing bind variable from Application module in ADF – Techartifact

Requirment- To execute the bind variable from application module- Or executing view criteria on page load

Solution- Assumption that you created a view object and view criteria .Now you have bind variable in view criteria.
You are passing the value using some managed bean stored in some scope.

Open the application module and go to data model .Select the the view object in which view criteria is this.Click on edit.

In the edit view instance dialog box.select the view criteria and shuttle to the right.now in the bind parameter value ,open the expression builder
and put right value like – “adf.context.sessionScope.LabelTemplate.taskId” .Here LabelTemplate is managed bean stored in session scope.

That all. Now run the page where you using view object.and page will load with result of bind variable.But note you cant use this VO anywhere where you don’t need a bind variable.

Enjoy coding with techaritfact