I will describe the how to set pivot table value at runtime .
My requirement is I have one drop down based on the user selection populate the pivot table content at runtime.
Here I am taking HR schema. There I created Employee and Deparment VOs.
Next I am adding the VOs as pivot table bindings to my page def file.
Click the add button from bindings section and select the ADF data visualization bindings.
There Select the pivot table bindings and add which vo you want create pivot table and choose the columns drag and drop to the table.
Selete next all and finish it. Like this do the same for Employee.
Now am create drag and drop pivot table form component palette. jspx page code here.
The pivot table value attribute is bind to managed bean so now am set the value in managed based my drop down selection.
private PivotTableModel activePivotTabVal;
public void setActivePivotTabVal(PivotTableModel activePivotTabVal) {
this.activePivotTabVal = activePivotTabVal;
}
public PivotTableModel getActivePivotTabVal() {
return activePivotTabVal;
}
public void changeEvent(ValueChangeEvent valueChangeEvent) {
String str = valueChangeEvent.getNewValue().toString();
String expValue = "";
if(str.equals("emp")){
expValue = "#{bindings.EmployeesView1.pivotTableModel}";
}else if(str.equals("dep")){
expValue = "#{bindings.DepartmentsView1.pivotTableModel}";
}
activePivotTabVal = (PivotTableModel)resolveExpression(expValue);
pivotTable.setVisible(true);
AdfFacesContext.getCurrentInstance().addPartialTarget(pivotTable);
}
Run the application. first my screen is
I hope this post is useful when you have this kind of req....
My requirement is I have one drop down based on the user selection populate the pivot table content at runtime.
Here I am taking HR schema. There I created Employee and Deparment VOs.
Next I am adding the VOs as pivot table bindings to my page def file.
Click the add button from bindings section and select the ADF data visualization bindings.
There Select the pivot table bindings and add which vo you want create pivot table and choose the columns drag and drop to the table.
Now am create drag and drop pivot table form component palette. jspx page code here.
private PivotTableModel activePivotTabVal;
public void setActivePivotTabVal(PivotTableModel activePivotTabVal) {
this.activePivotTabVal = activePivotTabVal;
}
public PivotTableModel getActivePivotTabVal() {
return activePivotTabVal;
}
public void changeEvent(ValueChangeEvent valueChangeEvent) {
String str = valueChangeEvent.getNewValue().toString();
String expValue = "";
if(str.equals("emp")){
expValue = "#{bindings.EmployeesView1.pivotTableModel}";
}else if(str.equals("dep")){
expValue = "#{bindings.DepartmentsView1.pivotTableModel}";
}
activePivotTabVal = (PivotTableModel)resolveExpression(expValue);
pivotTable.setVisible(true);
AdfFacesContext.getCurrentInstance().addPartialTarget(pivotTable);
}
Run the application. first my screen is
After user select the value from drop down, populate the content ...