Create ADF popup for value change event(For select one choice component).

Add popup and add dialog to inside of the popup,then select popup and add value for binding attribute in mine
#{pageFlowScope.popupBean.myPop}.
private RichPopup myPop = new RichPopup();
public void selectOneChoiceEvent(ValueChangeEvent valueChangeEvent) {
RichPopup.PopupHints ph = new RichPopup.PopupHints();
myPop.show(ph);
}
public void setMyPop(RichPopup myPop) {
this.myPop = myPop;
}
public RichPopup getMyPop() {
return myPop;
}

Oracle ADF - Add new custom attribute for view object using Expression

Oracle ADF Client-side Validators

Oracle ADF Association sample for Department and Employee

Wednesday, September 21, 2011

Oracle ADf – How to set background color of Table column using inlineStyle

Following example shows how to change background color of column using column’s attribute value.In this sample VO name is CustomVO and attribute is cusAttribute(Here If cusAttribute value greater than 100 background color red otherwise green)

<af:table value="#{bindings.CustomVO.collectionModel}" var="row">

<af:column custom data...

inlineStyle="#{row.cusAttribute > 100 ?'background-color:Red;':'background-color:green;'}">

<af:outputText value="#{row.cusAttribute}" id="ot5">

</af:outputText>

</af:column>

Wednesday, September 14, 2011

Oracle ADF - Working with oracle.jbo.domain.Date

Use case is get oracle.jbo.domain.Date for specific calender

public oracle.jbo.domain.Date toOracleDate(java.util.Calendar calendar) {

oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date();

Timestamp t = jboDate.timestampValue();

t.setTime(calendar.getTime().getTime());

return new oracle.jbo.domain.Date(t);

}

Monday, September 12, 2011

Oracle ADF – Date validation for future date

//Your Page
<af:inputDate label="Label1" id="id1s" rendered="true">
<af:validateDateTimeRange maximum="#{SampleBean.maxDate}"/>

</af:inputDate>

//Bean code stuff

public Date getMaxDate(){
Calendar cl = Calendar.getInstance();
cl.setTime(new Date());
cl.add(Calendar.DATE, 1);// you can alter max dates from here.. 0,1,2..
Date toDate = cl.getTime();
return toDate;

}

Oracle ADF – Get current Row from Iterator

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

DCIteratorBinding iterator = bc.findIteratorBinding("customVOIterator");

Row r = iterator.getCurrentRow();

String val = (String)r.getAttribute("customField");

Oracle ADF – How to access binding value of UI component using a bean class

<af:inputText value="#{bindings.Name.inputValue}"

id="Name" >

<f:validator binding="#{bindings.Name.validator}"/>

</af:inputText>

// get the binding container

import oracle.binding.AttributeBinding;

import oracle.binding.BindingContainer;

import oracle.adf.model.BindingContext;

BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();

// get an ADF attribute value from the ADF page definitions

AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("Name");

String val =

attr.getInputValue();