Tuesday, May 19, 2015

Read a parameter from URL ADF

HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
System.err.println("GET :" + request.getParameter("name"));
In the taskflow add a method to get the parameter from URL
init method and jsff in the taskflow; add the taskflow to the jspx page
init method is the initiator for the taskflow which gets the parameter from the URL 
Example to pass parameter to  URL: http://vijaysadhu.blogspot.com/search?q=url
http://host:7001/App/faces/home.jspx?name=vijay
set the value to a scope variable to use it in the app;
Another Approach:
        String currencyCode =
            FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("currencyCode") ==
            null ? "0" :
            FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("currencyCode");
        
String reportType =
            FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("reportType") == null ?
            "0" : FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("reportType");
       
        System.out.println("currencyCode - " + currencyCode + " - company - " + company + " - reportType - " +
                           reportType );
Example: http://127.0.0.1/App/faces/demo.jspx?currencyCode=USD&reportType=Q3







Monday, May 4, 2015

Align the column header and components in the column to "center" in af:table ADF

Column Header:

Add the tag align="center" 

Component in Column Header:

Add the tag inlineStyle="text-align:center;"

Example:

<table>
<af:column id="c23" align="center" headerText="Column Header" width="7%" inlineStyle="text-align:center;">
</table>

Select Boolean Check Box in af:table columns gets reset for the First Time ADF

  • Probably the Iterator is being refreshed (change the event policy of the Iterator to none from PPR) - this worked for me. Also make the Iterator refresh ifNeeded
  • http://vtkrishn.com/2011/01/18/changeeventpolicy/