Skip to main content

Posts

Resetting component values in actionEvent

       actionEvent is the event on which you want to reset the component values to null or clear the previous values in popup or UIComponent. For that use the following code.    UIComponent comp = actionEvent .getComponent();    oracle.adf.view.rich.util. ResetUtils.reset(comp); here comp is the component binding .

Getting Businss days in JAVA/ADF

Use the following class in your application to get the Business days getBusinessDateAdded   - is the method which will accept the number of daya of future ,and second parameter is the DB connection as here i am using the DB query direct to get the holidays. you can customise this as per your need package org.adr.prism.casemgt.ui.bean; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang.time.DateUtils; /* This bean is used to get the business days on the given oracle domain date  * 04-Julu-2013  * @sachin  */ public class BusinessDays {     public BusinessDays() {         super(...

Get Business Days in JAVA

you can customise this code as per your requirement if u need previous business day then just give - value instead of 1 in red area --------------------------------------------- import files ------------------------------------- import java.util.Calendar; import java.util.HashMap; import java.util.Map; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; import org.apache.commons.lang.time.DateUtils; import org.apache.log.Logger;    ----------------------------------------  private void setExpectedPerfectionDate () {         Row printakeRow =ADFUtils.findIterator("CasePreIntakeVOIterator").getCurrentRow();         oracle.jbo.domain.Date createdDate=null, updatedDate =null;         if (printakeRow != null) {  ...

El expression in ADF for substring

El Expression for getting the substring example :  rendered="#{fn:substring(pageFlowScope.Id,0,2) eq '01'}"    following expression gives you the substring of variable Id(which is in pageflowscope) "#{ fn:substring(pageFlowScope.Id,0,2) eq '01'}" for this you need to import the following file in your .jsff page  xmlns:fn=" http://java.sun.com/jsp/jstl/functions "

Accessing Data Controls and Bindings

1.To Get Attributre Value from iteraor binding         DCBindingContainer dcBindings = (DCBindingContainer)                                                                   BindingContext.getCurrent().getCurrentBindingsEntry();            DCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("yourVOIteratorName");            Number Id = (Number)iterBind.getCurrentRow().getAttribute("ItemId");   2.Accessing Data Controls and Bindings Access AM DCBindingContainer bc = getBindingContainer(); SomeAppModule test...

Setting a bind variable value programmatically

  To set the value of a bind variable programmatically, 1. first get the   View Object  where the bind variable is defined. 2.Then from the   View Object  you need to get access to the  VariableValueManager   via the call  ensureVariableManager().   3. F inally you need to call  setVariableValue()   on the  VariableValueManager  to set the bind variable to a specific value . 4.Once all these are done, execute the View Object query with the new bind variable value by calling  executeQuery()    on the view  as shown below. Example:          ViewObjectImpl view = this.getYourView();         VariableValueManager vm = view. ensureVariableManager() ;         vm. setVariableValue ("bindVariableName", valuetoSet);         view.executeQuery();

Gettign AM connection in Managed Bean and accessing VO's

 public String genBillLine(ArrayList finalArray,String caseId){           CaseMgtAMImpl caseAM = null;      FinanceAMImpl finAM=null;      String result=null;      try{           testAM = (testAMImpl)Configuration.createRootApplicationModule("og.dr.sm.mgt.model.am.testAMImpl","testAMLocal");    // getting AM            finAM = (FinanceAMImpl)Configuration.createRootApplicationModule("og.dr.finmgt.model.am.FinanceAMImpl","FinanceAMLocal");          ArrayList partyIds=getPartyIds(caseId);          ViewObject billVo=finAM.getFinBillLinesVO();          Iterator it=finalArray.iterator();               ...