Flipkart Search

Sunday, 25 November 2012

Static list in ADF the other way

The manage bean property of ADF can also provide the static list without a actual managed Bean{Interesting ??}. Let's do with an Example.
Inside your adfc-config.xml or your page-flow.xml register this list as below

  <managed-bean id="__3">

and access the pair  in EL as #{StaticBean['rahulkaitian']}

Sunday, 11 November 2012

Get and set task-flow input parameter value in managed bean

1. Method to get the value of TaskFlow inputParameter value 
public static Object getPageFlowParamVal(String tf_paramName){
  ADFContext adfContext = ADFContext.getCurrent();
  return adfContext.getPageFlowScope().get(tf_paramName);
2.  Method to set the value of TaskFlow inputParameter value 
public static void putPageFlowVarVal(String pageFlowScopeVarName,
 Object pageFlowScopeVarVal) {
     ADFContext adfContext = ADFContext.getCurrent();

Sunday, 28 October 2012

Refresh a Web Service Data Control without Deletion



13.3.4 How to Refresh a Web Service Data Control

Using Resource Bundle in adf managed bean

After configuring  ResourceBundle in faces-config.xml {Should be in working condition}, you can access (key,value) in manage bean as

ResourceBundle res = ResourceBundle.getBundle("Resource_base_name");
String value1=res.getString(" key1");

Monday, 25 June 2012

Must see ADF Videos

1. Starting An Enterprise ADF Project

2. Rich Web UI made simple - an ADF Faces Overview

ADF Project Intergration / Integration of ADF Projects

There are two ways of Integrating adf projects as far as I know::

1. SVN
2. ADF library jars

Setting up SVN and integrating the project is left as it is not much of adf special feature…..
I am gonna describe how to Integrate several adf projects through adf library jars…..

Here the use case is – I have to integrate ProjectB into Project A

1. Here we create only adf task flows in ProjectB to integrate into ProjectA

2. Create a new AppModule in ProjectB…
Important note:: Make sure your appmodule has a different name than the project you are integrating with , like if integrating with projectA then in projectB name the appmodule as AppmoduleProjectB1, AppmoduleProjectB2, AppmoduleProjectB3 etc. -like this if you have multiple appmodules(or you can name it as your module specific name )- Also make sure Appmodule is created in Model of the project

3. Make sure you always add your viewobjects always inside your appmodule
Click on browse {the last one} and select your appmodule
4. Now created a task-flow that is to be integrated in ProjectA { I named it as project-test-task-flow} and inside it created a view as testB.jsff

5. After creating the adf task flow{page-flow} the time has come to make a adf library jar..
Right click on view-controller >Project Properties>Deployment>Use Custom Settings>customize settings>New>Archive type>ADF Library Jar File> Name can be anything you like {unique}

6. Now Right click on view-controller >Deploy >jar name you choose
Make sure your deployment is successful
Deployed jar location is \ViewControllerProjectB\deploy

7. Time to go to ProjectA .. create a new file system connection if not existed already with above deployed library jar location

Or paste the jar in existing jar location ,In ProjectA make sure you are creating a jsf page for task flows to Display>then add Library to project
8. Create a jspx page in Project A: You have to create a jspx page to render the page fragment of project B. In this jspx make sure you have a region[facet] in which task flow from project B can be dropped.

Now you can see the integration  as  partial render in design view 

Now the final render in the Browser

Sunday, 15 April 2012

Showing User Specific Table data in Adf - Part 1

This is a very normal use case where a user has to see his own data. We usually do it by saving userdata in DB according to some UserId{Like emailId } or some specific number or anything...For this tutorial you should have a table with user specific data....For this example I took Employee table of HR schema .....
There are two methods to do this.....
1. Execute with Params{With Bind Variables}
2. ViewObject Implementation Class
In Part 1. I will how to achieve this goal by Execute with Params{With Bind Variables}...
1. First create a desired VO and Bind a variable to it.{This should be the your userId which can be anything}
2. Now give a where clause to your VO which binds your bind Variable

3. Now create a task-flow{or a jspx page}......I prefer taskflow to ensure re usability...

4. Now add a view to it ..and make sure you select document tpye: JSP XML

5. Now go to datacontrol and expand your employee collection and go to operation section and drag and drop ExecuteWithParams to your page as an ADF parameter Form 
6. Now drag and drop your table on the same jsff page see above..
7. Now go to jsff page Bindings and then go to structure window{left below corner}and you can see Executables . Now right click on Executables->Insert Inside executables->invoke Action. Give any string as id and Binds as ExecuteWithParams . Go to its property and make refresh:always {Note: click on the image below for better visibility}

8. Now again go to binding tab of the jsff page{you must be there already }. See the cursor{Means edit the bindings->ExecuteWithParams

9. Now you will see the dialog as below...go to value -> show El  Expression Builder

10. Now delete the existing text and map it to security context user name...
11. Now you can delete the adf parameter form in the jsff page{So that user can't view it}.. or you can make the adf panel form layout render false which contains the ExecuteWithParams form field and Button

12. Now you have to give a login page to the user so that he can give his user name and password to login and see his data...In adf this is very simple...Go to Application->Secure->Configure ADF security...

Follow the next screens as it is--

13. Now click next-next or finish and open Application Resources->Descriptors->META-INF->jazn-data.xml and add your user and give userId as Name
14. Add an application role and add the existing user to this role...

15. Now go to resource Grants tab then Resource Type->Task Flow and give your task grant to application rule..

16. Now create a blank jspx page and drop adf page flow into it as region
17. Now grant this jspx to the same application role....
18. Now run your application and Enjoy
see the sample..earlier
 And now with ExecuteWithParams

Friday, 6 April 2012

Clean Adf Table filter without Managed Bean

When you have a Adf filterable table then you may have noticed that the text inside the filter don't clear itself when you navigate to other page . It remains there. There are two ways to clear the filters as far as I know.
1. Setting One of the output text column header true
2. A button with managed bean

Adf table's column property RowHeader is set to true then this column renders as a non filterable column with a Clear All icon which clears all filters and reloads the table

1. Setting a Column which is Output Text type to RowHeader=true

2. Earlier look   RowHeader=false
3. Now with  RowHeader=true

Best adf page layout

I have worked on different page layouts and found the below layout Best . Because this layout doesn't depends on screen size of the browser or Monitor. It is stretchable  all across except its top facet.
Here is the screen shot of the said layout...
To create this layout go to ViewController>New>Jsf>page>pagelayout>quickstart layout then
The exact layout is very much dependent on your requirement ...But this layout will help u most because it fixes only top facet ....

Monday, 2 April 2012

Precautions During ADF Fusion WebApplication project

If you are making a ADF webapplication then you must aware about some of the basic problems you can came around.
The most common problem is Screen Resolution. What I mean by screen resolution is that user may be on different screen resolution than your during development screen. An example may clear more:: 
For development you have resolution of 1280*1024 and every thing looks fine but even 1024*768 can ruin your application easily.
This happens usually when you try to fix the size of a stretchable component like table etc.In the following example I didn't set the size of table's width then it can accommodate any screen size because its a stretchable component.See below...
Now what I do is - I fix the size of table and see what happens...

Now see what happens when I decrease the browser's size ...
 Although I have scrolled horizontally till end but I can't see the columns after Salary
So don't try to set the width of  adf table ...