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

Sunday, June 17, 2012

Oracle ADF - Hot to convert upper case to input text values

-Using JavaScript
function toUpperCase(event) {
var inputField = event.getSource();
inputField.setValue(event.getNewValue().toUpperCase());
}

<:af:clientListener method="toUpperCase" type="valueChange"/>:

Or
-Using following CSS
<:af:inputText label="Hello World" id="it1" contentStyle="text-transform:uppercase;"/>:

Wednesday, June 6, 2012

Oracle ADF - How to iterate view object using java code

Following code stuff can be used to iterate view object without any effect to current view object.

ViewObjectImpl viewObject = getTestObject();
RowSetIterator iterator = viewObject.createRowSetIterator(null);
iterator.reset();
while (iterator.hasNext()) {
Row row = iterator.next();
// process the row here
}
iterator.closeRowSetIterator();

Oracle ADF - Another user has changed the row with Primary key

See : Chris Muir's blog : The case of the phantom ADF developer
Note : You can get above error while inserting/updating , the same entry altering using trigger or procedure. this.getTransaction().setLockingMode(DBTransaction.LOCK_NONE);

Thursday, February 16, 2012

ADF - Show faces message for relevant copmonents

Using following method can show error messages for relevant component,

final int MSG_FATAL = 1;
final int MSG_ERROR = 2;
final int MSG_WARN = 3;
final int MSG_INFO = 4;
public void showMsgForRelevantComponentAll(int iSeverity, String sMsg, UIComponent uIComponent) {
FacesMessage msg = null;
switch (iSeverity) {
case MSG_FATAL:
msg = new FacesMessage(FacesMessage.SEVERITY_FATAL, null, sMsg);
break;
case MSG_ERROR:
msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, sMsg);
break;
case MSG_WARN:
msg = new FacesMessage(FacesMessage.SEVERITY_WARN, null, sMsg);
break;
case MSG_INFO:
default:
msg = new FacesMessage(FacesMessage.SEVERITY_INFO, null, sMsg);
}
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.addMessage(uIComponent.getClientId(facesContext), msg);
}