Create ADF popup for value change event(For select one choice component).
Oracle ADF - Add new custom attribute for view object using Expression
Oracle ADF Client-side Validators
Oracle ADF Association sample for Department and Employee
Thursday, December 15, 2011
Oracle Adf - Set values to current row attribute through bindings.
setEL("#{bindings.YourField.inputValue}","p");
//setEL implementation
public void setEL(String el, Object val) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ELContext elContext = facesContext.getELContext();
ExpressionFactory expressionFactory =
facesContext.getApplication().getExpressionFactory();
ValueExpression exp =
expressionFactory.createValueExpression(elContext, el, Object.class);
exp.setValue(elContext, val);
}
//
In pagedef you should have bindings for above attribute
<attributeValues IterBinding="YourVOIterator" id="YourField">
<AttrNames>
<Item Value="YourField"/>
</AttrNames>
</attributeValues>
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();