Friday, January 11, 2013

Action Or Action Listener which is called first?

Action Listener then Action

Action Listener is called First

Difference between Action Listener vs Action
AL - return type void A- return type String
AL- accepts parameters A-Doesn't
AL- Can't Navigate to another page A- we can navigate to another page


How to pass a parameter to AL?
http://www.gebs.ro/blog/oracle/adf-send-parameter-to-actionlistener/

Thursday, January 10, 2013

Get TaskFlow's PageFlowScope Parameter in BackingBean


        ADFContext adfCtx = ADFContext.getCurrent();
        Map pageFlowScope = adfCtx.getPageFlowScope();    
        Object val = pageFlowScope.get("attributeName")

Monday, January 7, 2013

Programmatic PPR

//Refresh the component from managed/backing bean AdfFacesContext.getCurrentInstance().addPartialTarget(componentBinding);

Sunday, January 6, 2013

Remote Debugging

Get the current selected value in the backing bean on ValueChangeListener() of SelectOneChoice ADF

 

public void valueChanged(ValueChangeEvent valueChangeEvent) throws Exception{

valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());

DCBindingContainer bindings =

(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();

DCIteratorBinding iter =

bindings.findIteratorBinding("CountryTRVOIterator");

CountryTRVORowImpl countryRow= (CountryTRVORowImpl) iter.getCurrentRow();

System.out.println(countryRow.getCountryId());

}

or

public void valueChanged(ValueChangeEvent valueChangeEvent){

OperationBinding oper1 = ADFUtils.findOperation("GetHyperLinkEWP");

if (JSFUtils.resolveExpression("#{bindings.ActionRef<attribute_in_bindings>.selectedValue.attributeValues[1]}").toString().equals("Compliant")) {

oper1.getParamsMap().put("BindLabel", "Approval Report");

System.err.println("Approval Report");

} else {

oper1.getParamsMap().put("BindLabel", "Rejection Report");

System.err.println("Rejection Report");

}

oper1.execute();

}

or

if you are trying to get the new value of the select one choice before the value gets updated to model

public void valueChanged(ValueChangeEvent valueChangeEvent) {

this.setValueToEL("#{bindings.Deptno.inputValue}", valueChangeEvent.getNewValue()); //Updates the model

System.out.println("\n******** Selected Value: "+resolveExpression("#{bindings.Deptno.attributeValue}"));

System.out.println("\n******** Display Value: "+resolveExpression("#{bindings.Deptno.selectedValue ne ' ' ? bindings.Deptno.selectedValue.attributeValues[1] : ''}"));

}