Posts

Showing posts from September, 2014

Make View Object Attribute Selectively (Optionally) Required in af Query

Image
Hi All, In this post I am going to show how you can make the attributes in af query optionally or selectively required as shown below. You can see that in above screenshot that it is asking for at least one of the attribute to fill. In order to this we have to do slight modification in our View Criteria. In view criteria select your attribute and specify the "Validation" property as "Selectively Required" as shown below. Now run your page and specify any of the attribute value and click on search you will get your desired result.

Hide Fields From Add Fields Section in af Query Advance Mode

Image
Hi All, In this post I am going to show you how you can hide unwanted fields in advance mode of af query. If you see the screenshot below you can see that in "Add Fields" we can see all the attributes present in EmployeesVO. Suppose I want to hide ManagerId and "DepartmentId" in Add Fields option of af:query. In order to hide this we have to go to view object and edit that attribute and then make Queryable to false as shown below. Same thing you have to do with ManagerId attribute. Now Run your page again go to Advance Mode of af:query. You will notice that these two attributes are not visible at all.

Export Selected Rows Only in ADF Table

Image
Hi All, In this post I am going to show you that how you can export the selected rows only present in the ADF table. Suppose if you have a ADF table in your application with a button to export the table data in excel. By default it will export all the rows present in the table. When you see the code for exporting all rows present in table to excel in your page it will be somewhat like this:   <af:commandButton text="Export Selected Row" id="cb1">           <af:exportCollectionActionListener exportedId="t1" type="excelHTML"                                              filename="export.xls"/>         </af:commandButton> where " t1 " is the id of the ADF tab...

Hide or Disable value in SelectOneChoice In ADF

Image
Hi All, I am going to show that how you can hide/disable the value present in SelectOneChoice component in ADF. Suppose I have a department selectOneChoice LOV. Now I want to hide/disable  some of the value. So suppose in above shown LOV I want to hide "Sales" option. When you go to your page source you will see that the following code is generated for this SelectOneChoice in you jspx/jsff page.   <af:selectOneChoice value="#{bindings.DepartmentId.inputValue}"                               label="#{bindings.DepartmentId.label}"                               required="#{bindings.DepartmentId.hints.mandatory}"            ...

Color ADF table column based on condition

Image
Hi All, Today we will see how you can color the table column based on some condition. so suppose you have a ADF table based on employees table. Now you want to color the EmployeeId column for those employee whose DepartmentId is 30. Now when you go to page source of your jspx/jsff page then you will see the following code for EmployeeId column.  <af:column sortProperty="EmployeeId" filterable="true" sortable="true"                      headerText="#{bindings.EmployeesVO1.hints.EmployeeId.label}"                      id="c8">             <af:outputText value="#{row.EmployeeId}" id="ot7">               <af:convertNumber groupingUsed="false" ...

Showing Master Detail row in one ADF table

Image
Hi All, Today I am going to show how you can show the master and detail row in same table. In order to show this you have to create you View Object based on master as well as detail Entity Object linked with association as shown below. Then go to Attribute section and Add the Attribute from Entity Object as shown below. Then select the attribute according to your wish from DepartmentEO. For my example I have selected all and click on ">" icon. Now click on Ok button. Now go to your page and create the table based on attributes from Employee table only. as shown below. and click on Ok. Now go to Structure Palette and right click on the table and select the option "Facet-Table" then select Detail Stamp" option as shown below. Now drag and drop the view object from data control to the detailStamp facet as read only form and delete the attributes from EmployeeEO in the popup and keep only attributes from DepartmentEO. Cli...

Dependent LOV (SelectOneChoice) for country state exmplae in ADF

Image
Hi All, Today I am going to show how you can create the dependent LOV in ADF. Suppose for example we are taking countries and states LOV example. So whenever you change the country in LOV the states SelectOneChoice should show the valid states for that particular selected country. To demonstrate this I have created some tables and insert some value in those tables. You table should have something relationship like this only.. create table country ( country_id number(8,0), state varchar2(10) ); insert into country values (1, 'BNG'); insert into country values (2, 'TX'); insert into country values (3, 'LON'); insert into country values (4, 'SDY'); insert into country values (5, 'CGG'); create table state_name( state_id varchar2(10), state_name varchar2(2000), country_id number(8,0) ); insert into state_name values ('BNG', 'Bangalore', 1); insert into state_name values ('DEL', 'Delhi', 1); insert into...