Dynamic Tab Implementation in ADF
Posted
by Vijay Mohan
on Oracle Blogs
See other posts from Oracle Blogs
or by Vijay Mohan
Published on Sun, 25 Apr 2010 04:19:00 +0000
Indexed on
2010/04/25
4:45 UTC
Read the original article
Hit count: 414
Filed under:
Well, this can be a common usecase across apps to open tabs dynamically at runtime based on the request.
Well, in order to achieve this you can have a parent container, lets say a panelTab component.Inside panelTab , u can have a showDetailItem inside an af:foreach or an af:iterator binded to a bean static list which will have as many show detail items as you wish to be shown.
something like this.
private static List = { new showDetailItem("1"),new ShowDetailItem("2") ...};
now in the backing bean you can have a method that takes care of rendering and disclosing an specific tab based on the index.
public void openMyTab(){
List<MyItems> list = refToParentContainer.getChildren();
int indexOfTabToBeOpened = //Write a method that will compute the tab index of the next //tab.
list.get(index).setRendered(true);
list.get(index).setDisclosed(true);
similarly you can set other properties too.
}
Else, instead of having af:foreach/iterator iterating through the SD items , you can go for static SDs in the page with render property set to false and then you can follow the same approach to render/disclose it at runtime.
Well, in order to achieve this you can have a parent container, lets say a panelTab component.Inside panelTab , u can have a showDetailItem inside an af:foreach or an af:iterator binded to a bean static list which will have as many show detail items as you wish to be shown.
something like this.
private static List = { new showDetailItem("1"),new ShowDetailItem("2") ...};
now in the backing bean you can have a method that takes care of rendering and disclosing an specific tab based on the index.
public void openMyTab(){
List<MyItems> list = refToParentContainer.getChildren();
int indexOfTabToBeOpened = //Write a method that will compute the tab index of the next //tab.
list.get(index).setRendered(true);
list.get(index).setDisclosed(true);
similarly you can set other properties too.
}
Else, instead of having af:foreach/iterator iterating through the SD items , you can go for static SDs in the page with render property set to false and then you can follow the same approach to render/disclose it at runtime.
© Oracle Blogs or respective owner