Posts

Showing posts from December, 2013

Open public URL programatically using javascript in ADF

Scenario:  Suppose you want to open some public URL like www.google.com programatically from you ADF application. Write the following code in bean on Action event.     public void openURL(ActionEvent actionEvent) {         openUrlInNewWindow("http://www.google.com");     }         private void openUrlInNewWindow(String url) {            if (url != null) {                String javaScriptText =                    "window.open('" + url + "', 'Window', 'menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes');";                writeJavaScriptToClient(javaScriptText);            }        }       public static void writeJavaScriptToClient(String script) {       ...

Overriding labels and Tooltip of input list of value programatically in ADF

Image
Scenario: Suppose you have a LOV which has already labels and tootip for the attributes present in LOV. Now you have some requirements like you have to reuse this LOV but the labels and tooltip must be different. This you can handle programatically also. Suppose we have some labels and tooltip already for LOV as follows: Now suppose you want the labels and tooltip for Dept. Id. should be "Department Number" and "For Dept. Name should be "Department Name". In order to this you have to do following steps: 1. Create your bean class says LOVBean. 2. Override "launchPopupListener" in inputListOfValues as follows:        <af:inputListOfValues id="departmentIdId"                                 popupTitle="Search and Select: #{bindings.DepartmentId.hints.label}"                               ...

Customizing table filter and show inline error message for numeric field in ADF table

Image
When you create a table with filter in ADF and the filter is based on Numeric value then when you enter some string value in filter and press enter it will throw error message in a popup. But what if we need to show it at filter level only. It is very simple. When you open the code of your corresponding column you will see the following code.   <af:column sortProperty="EmployeeId" filterable="true" sortable="true"                      headerText="#{bindings.EmployeesVO1.hints.EmployeeId.label}"                      id="c2">             <af:outputText value="#{row.EmployeeId}" id="ot2">               <af:convertNumber groupingUsed="false"                                 pattern="#{bindings.Employee...