Skip to main content

Posts

Showing posts with the label ADF Faces

Set a PanelTab height dynamically using JavaScript

It's not a common scenario but interesting to note down what's the use case and how to implement it. The use case is to get the view port height on the ADF page and set height to the PanelTab or other component related to the view port height. Most sites are still designed with flow layout on fixed width of the page. Users would have all kinds of different desktop resolutions so that their browser would render the ADF pages a bit differently. Some with large resolution would have large blank space. To make the site more appealing (or even readable at least) and fit into different browser window sizes, we can definitely control the heights of ADF components using JavaScript. In this example, we will look at the PanelTab component but it can be applied to any other ADF components. There is actually a web design - responsive web design - supposed to solve these kind of problems and render the site in multiple platforms. But the solution in this blog is more or less a fix/worka...

ADF Faces Naming Container Components

(Sorry I was not giving a complete description of the topic here. Apologize to the readers who has requested me to give a full article on this a while back). Naming Container will not sound unfamiliar if you are developing ADF. Naming Container is a mechanism in ADF to uniquely specify an Id of a component. It's nothing but a naming space attached to its underlying children components and make them unique in the ADF Faces component hierarchy so no components have duplicate Id. All the Naming Container Components in ADF should implement the NamingContainer Interface . Any children components under the naming container components will have to use its parent naming container id as their prefix in the fully qualified component id. If there are multiple naming container components nested, then multiple naming container prefix will be used. The prefix is separated by ":".  A  component that is located in a naming container thus always has an id value of ...

Page Navigation using JavaScript in ADF Faces

Recently I posted a question on the Oracle ADF forum asking if there is Javascript API for page navigations in ADF faces and the simple answer is NO. My Original Post: I have a UI user case that has a af:menu which contains mutiple af:goMenuItem. When user click on the menu, the menu slides down and shows up the af:goMenuItem. As we know, you could define the page destinations in af:goMenuItem to go to another page when user clicked, but af:menu itself cannot be redirected to another page. Well, the user case wants the menu itself could be redirected if user click on it.   So I am thinking using JavaScript to do this: when the af:menu gets clicked, redirect to another page. BUT, I looked over the ADF Faces Javascript API and was not able to find that piece of code to do this. Any help??? Frank's Response: 1 - you can have a hidden command item to do the navigation based on a control flow case. In this case, you access the command component from JavaScript create a new Ac...

About ClientListener and ServerListener

ClientListener , by its meaning, is fired/triggered by its source component to execute some client side script been defined in java scripts. Oracle defines it as "The clientListener tag is a declarative way to register a client-side listener script to be executed when a specific event type is fired. This tag will be ignored for any server-rendered components, as it is only supported by rich client components." Before using the clientListener tag, be sure to look for any existing behavior tags which might eliminate the need for scripts. ClientListener is more generic and could be used anywhere there is a need for java scripts insertion. But ADF already provides some specific tag listener for some special occasion,  for example: the af:showPopupBehavior tag simplifies what it takes to display a popup. This example will invoke the JavaScript method "showPopupFromAction" when the button is clicked and will then manually display a popup. ServerListener , is fir...