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

Thursday, February 24, 2011

ADF include page or page fragment in another page.


To achive this task add following code stuff in your page.in mine second.jsff is the included page.

Wednesday, February 23, 2011

How to get table selected row values from bean class

(1)Drag any view from data controler in mine (sampleView1)
(2)Then will give an popup and select
Table ->ADF Read only table, and select(Check) the rew selection and press ok.
(3)Add bean class to following code stuff
public void processSelectionSL(SelectionEvent selectionEvent) {

RichTable richTable = (RichTable)selectionEvent.getSource();
CollectionModel tableModel = (CollectionModel)richTable.getValue();
JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
Object selectedRowData = richTable.getSelectedRowData();
JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
for (Object o : nodeBinding.getAttributeValues()) {
System.out.println("Selected values " + o);
}

}
(4)In design select table and search under selectionlistner method define bean ,in mine(TraineeBean) is the bean class(If your bean class define pageFlow scope add following)
#{pageFlowScope.TraineeBean.processSelection}
Or bean define in session scope
#{TraineeBean.processSelection}

Monday, February 21, 2011

How to get Select Many Shuttle values by bean class.

How to get Select Many Shuttle values by bean class.
(1)First you have to ViewObject and then drag your view object(SampleView1) to design area
(2)Then it ask for creating several types of components and select
Multiple Selection -> ADF Select Many Shuttle
(3)Now you can see Edit List Bindings window with selected data source(SampleView1) and select base attribute and display attribute
(4)drag command button and add following code stuff to your class (keep in memory change SampleView1 to your viewObject name)

public void processSelection(ActionEvent actionEvent) {
BindingContainer bindContainer = BindingContext.getCurrent().getCurrentBindingsEntry();
JUCtrlListBinding listBinding = (JUCtrlListBinding)bindContainer.get("SampleView1");
Object[] obj = listBinding.getSelectedValues();
for (Object o : obj) {
System.out.println("Selected values"+o);
}
}


(5)select command button's action listner and find your method through this action listner(Not through action)

Tuesday, February 1, 2011

ADF - Add textField value to multiSelect Component in button click event

Write following code your bean and try..


private List listOfItems = new ArrayList();//to shown combo,bind this list to combo
String txtFieldValue;//txtFld bind value

public void Test(ActionEvent actionEvent) {//bind to button action listner
{
String value = (String)getTxtFieldValue();
if (value != null && !value.equals("")) {
SelectItem si = new SelectItem();
si.setLabel(value);
si.setValue(value);
listOfItems.add(si);
myTestListComponent.setValue(listOfItems);
newItemNameComponent.setValue("");
}
}
}

public void setListOfItems(List listOfItems) {
this.listOfItems = listOfItems;
}

public List getListOfItems() {
return listOfItems;
}

public String getTxtFieldValue() {
return txtFieldValue;
}

public void setTxtFieldValue(String txtFieldValue) {
this.txtFieldValue = txtFieldValue;
}