Oracle ADF multiple Tabs with TabbedPanel:
package view;
import java.util.Iterator;
import javax.faces.component.UIComponent;
import javax.faces.event.ActionEvent;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.rich.component.UIXTable;
import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.layout.RichPanelTabbed;
import oracle.adf.view.rich.component.rich.layout.RichShowDetailItem;
import oracle.adf.view.rich.component.rich.layout.RichToolbar;
import oracle.adf.view.rich.component.rich.nav.RichButton;
import oracle.adf.view.rich.component.rich.output.RichOutputText;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adfinternal.view.faces.model.binding.FacesCtrlHierNodeBinding;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
import oracle.jbo.uicli.binding.JUCtrlHierNodeBinding;
import org.apache.myfaces.trinidad.event.DisclosureEvent;
public class View4 {
private String userInputValue;
private String userOutputValue;
private String gbName;
private RichOutputText outputText;
private RichPanelTabbed panelTabbedBind1;
private RichShowDetailItem tab1;
private RichShowDetailItem tab2;
private RichShowDetailItem tab3;
private RichShowDetailItem tab4;
private RichShowDetailItem tab5;
private RichShowDetailItem tab6;
private RichShowDetailItem tab7;
private RichShowDetailItem tab8;
private RichShowDetailItem tab9;
private RichPanelTabbed panelTabbedBind2;
private RichPanelTabbed panelTabbedBind3;
private RichButton hideButton;
private RichButton showButton;
private RichToolbar toolbarRefresh;
private RichTable employeeTable;
public View4() {
}
public void setUserInputValue(String userInputValue) {
this.userInputValue = userInputValue;
}
public String getUserInputValue() {
return userInputValue;
}
public void setUserOutputValue(String userOutputValue) {
this.userOutputValue = userOutputValue;
}
public String getUserOutputValue() {
return userOutputValue;
}
public void testButtonClick(ActionEvent actionEvent) {
System.out.println("**** testButtonClick ****");
String bName = getUserInputValue();
System.out.println("*** User Given BName=" + bName);
gbName = bName;
setUserOutputValue(bName);
AdfFacesContext.getCurrentInstance().addPartialTarget(outputText);
}
public void setOutputText(RichOutputText outputText) {
this.outputText = outputText;
}
public RichOutputText getOutputText() {
return outputText;
}
public void TabButtonClick(ActionEvent actionEvent) {
System.out.println("**** TabButtonClick ****");
String bName = getUserInputValue();
System.out.println("*** User Given BName=" + bName);
RichShowDetailItem Tabbutton = getTab1();
if (bName.equalsIgnoreCase("Tab1"))
Tabbutton = getTab1();
else if (bName.equalsIgnoreCase("Tab2"))
Tabbutton = getTab2();
else if (bName.equalsIgnoreCase("Tab3"))
Tabbutton = getTab3();
else if (bName.equalsIgnoreCase("Tab4"))
Tabbutton = getTab4();
else if (bName.equalsIgnoreCase("Tab5"))
Tabbutton = getTab5();
else if (bName.equalsIgnoreCase("Tab6"))
Tabbutton = getTab6();
else if (bName.equalsIgnoreCase("Tab7"))
Tabbutton = getTab7();
else if (bName.equalsIgnoreCase("Tab8"))
Tabbutton = getTab8();
else if (bName.equalsIgnoreCase("Tab9"))
Tabbutton = getTab9();
setDisclosedTab(Tabbutton);
}
public void setDisclosedTab(RichShowDetailItem tabBind) {
String statusFlag = "NotSelected";
//RichShowDetailItem RichtabBind11=getTab1();
RichPanelTabbed richPanelTabbed = null;
String tabBindText=tabBind.getClientId().toString();
System.out.println("*** tabBindText ="+tabBindText);
//System.out.println(Str.matches("(.*)com"));
if(tabBindText.matches("(.*)tab1") || tabBindText.matches("(.*)tab2") ||
tabBindText.matches("(.*)tab3")|| tabBindText.matches("(.*)tab4"))
{
richPanelTabbed = getPanelTabbedBind3();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (!sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
richPanelTabbed = getPanelTabbedBind2();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (!sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
richPanelTabbed = getPanelTabbedBind1();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
}
if(tabBindText.matches("(.*)tab5") || tabBindText.matches("(.*)tab6")
|| tabBindText.matches("(.*)tab7"))
{
richPanelTabbed = getPanelTabbedBind3();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (!sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
richPanelTabbed = getPanelTabbedBind2();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
richPanelTabbed = getPanelTabbedBind1();
RichShowDetailItem showDetailsTab2=getTab2();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if(sdi.getClientId().equals(showDetailsTab2.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
}
if(tabBindText.matches("(.*)tab8") || tabBindText.matches("(.*)tab9"))
{
richPanelTabbed = getPanelTabbedBind2();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (!sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
richPanelTabbed = getPanelTabbedBind3();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
richPanelTabbed = getPanelTabbedBind1();
RichShowDetailItem showDetailsTab2=getTab3();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if(sdi.getClientId().equals(showDetailsTab2.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
}
}
public void setDisclosedTab1(RichShowDetailItem tabBind) {
String statusFlag = "NotSelected";
RichPanelTabbed richPanelTabbed = null;
richPanelTabbed = getPanelTabbedBind1();
for (UIComponent child : richPanelTabbed.getChildren()) {
System.out.println("child Tabbed1=" + child.getClientId().toString());
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId())) {
sdi.setDisclosed(true);
statusFlag = "Selected";
} else {
sdi.setDisclosed(false);
}
}
if (statusFlag.equalsIgnoreCase("Selected"))
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
else if (statusFlag.equalsIgnoreCase("NotSelected")) {
richPanelTabbed = getPanelTabbedBind2();
for (UIComponent child : richPanelTabbed.getChildren()) {
System.out.println("child Tabbed2=" + child.getClientId().toString());
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId())) {
sdi.setDisclosed(true);
statusFlag = "Selected";
} else
sdi.setDisclosed(false);
if (statusFlag.equalsIgnoreCase("Selected")) {
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
}
}
} else if (statusFlag.equalsIgnoreCase("NotSelected")) {
richPanelTabbed = getPanelTabbedBind3();
for (UIComponent child : richPanelTabbed.getChildren()) {
System.out.println("child Tabbed3=" + child.getClientId().toString());
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId())) {
sdi.setDisclosed(true);
statusFlag = "Selected";
} else
sdi.setDisclosed(false);
if (statusFlag.equalsIgnoreCase("Selected")) {
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
}
}
}
}
public void setPanelTabbedBind1(RichPanelTabbed panelTabbedBind1) {
this.panelTabbedBind1 = panelTabbedBind1;
}
public RichPanelTabbed getPanelTabbedBind1() {
return panelTabbedBind1;
}
public void showpanelTabbed1DisListener1(DisclosureEvent disclosureEvent)
{
System.out.println("Select Tab String="+disclosureEvent.getComponent().getClientId().toString());
System.out.println("Select Tab String Heading="+disclosureEvent.getComponent()
.getAttributes()
.get("text"));
String SelectedTabBindStr=disclosureEvent.getComponent().getClientId().toString();
RichShowDetailItem Tabbutton=getTab1();
if (disclosureEvent.isExpanded())
{
if(SelectedTabBindStr.matches("(.*)tab1"))
Tabbutton = getTab1();
else if(SelectedTabBindStr.matches("(.*)tab2"))
Tabbutton = getTab2();
else if(SelectedTabBindStr.matches("(.*)tab3"))
Tabbutton = getTab3();
else if(SelectedTabBindStr.matches("(.*)tab4"))
Tabbutton = getTab4();
else if(SelectedTabBindStr.matches("(.*)tab5"))
Tabbutton = getTab5();
else if(SelectedTabBindStr.matches("(.*)tab6"))
Tabbutton = getTab6();
else if(SelectedTabBindStr.matches("(.*)tab7"))
Tabbutton = getTab7();
else if(SelectedTabBindStr.matches("(.*)tab8"))
Tabbutton = getTab8();
else if(SelectedTabBindStr.matches("(.*)tab9"))
Tabbutton = getTab9();
}
setDisclosedTab(Tabbutton);
}
public void showpanelTabbed1DisListener(DisclosureEvent disclosureEvent) {
String SelectedTabBindStr=disclosureEvent.getComponent().getClientId().toString();
System.out.println("*** SelectedTabBindStr="+SelectedTabBindStr);
if (disclosureEvent.isExpanded()) {
// The below code will return the selected tab name.
System.out.println("Select Tab String="+disclosureEvent.getComponent().getClientId().toString());
System.out.println("Select Tab String Heading="+disclosureEvent.getComponent()
.getAttributes()
.get("text"));
String selTab = disclosureEvent.getComponent()
.getAttributes()
.get("text")
.toString();
if (selTab.equalsIgnoreCase("Tab Label 1")) {
tab1.setDisclosed(true);
tab2.setDisclosed(false);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 2")) {
tab1.setDisclosed(false);
tab2.setDisclosed(true);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(true);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 3")) {
tab1.setDisclosed(false);
tab2.setDisclosed(false);
tab3.setDisclosed(true);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 4")) {
tab1.setDisclosed(false);
tab2.setDisclosed(false);
tab3.setDisclosed(false);
tab4.setDisclosed(true);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 5")) {
tab1.setDisclosed(false);
tab2.setDisclosed(true);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(true);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 6")) {
tab1.setDisclosed(false);
tab2.setDisclosed(true);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(true);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 7")) {
tab1.setDisclosed(false);
tab2.setDisclosed(true);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(true);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 8")) {
tab1.setDisclosed(false);
tab2.setDisclosed(false);
tab3.setDisclosed(true);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(true);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 9")) {
tab1.setDisclosed(false);
tab2.setDisclosed(false);
tab3.setDisclosed(true);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(true);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
}
}
public void setTab1(RichShowDetailItem tab1) {
this.tab1 = tab1;
}
public RichShowDetailItem getTab1() {
return tab1;
}
public void setTab2(RichShowDetailItem tab2) {
this.tab2 = tab2;
}
public RichShowDetailItem getTab2() {
return tab2;
}
public void setTab3(RichShowDetailItem tab3) {
this.tab3 = tab3;
}
public RichShowDetailItem getTab3() {
return tab3;
}
public void setTab4(RichShowDetailItem tab4) {
this.tab4 = tab4;
}
public RichShowDetailItem getTab4() {
return tab4;
}
public void setTab5(RichShowDetailItem tab5) {
this.tab5 = tab5;
}
public RichShowDetailItem getTab5() {
return tab5;
}
public void setTab6(RichShowDetailItem tab6) {
this.tab6 = tab6;
}
public RichShowDetailItem getTab6() {
return tab6;
}
public void setTab7(RichShowDetailItem tab7) {
this.tab7 = tab7;
}
public RichShowDetailItem getTab7() {
return tab7;
}
public void setTab8(RichShowDetailItem tab8) {
this.tab8 = tab8;
}
public RichShowDetailItem getTab8() {
return tab8;
}
public void setTab9(RichShowDetailItem tab9) {
this.tab9 = tab9;
}
public RichShowDetailItem getTab9() {
return tab9;
}
public void setPanelTabbedBind2(RichPanelTabbed panelTabbedBind2) {
this.panelTabbedBind2 = panelTabbedBind2;
}
public RichPanelTabbed getPanelTabbedBind2() {
return panelTabbedBind2;
}
public void setPanelTabbedBind3(RichPanelTabbed panelTabbedBind3) {
this.panelTabbedBind3 = panelTabbedBind3;
}
public RichPanelTabbed getPanelTabbedBind3() {
return panelTabbedBind3;
}
public void hideButtonClick(ActionEvent actionEvent) {
String bName = getUserInputValue().toLowerCase();
panelTabbedBind1.findComponent(bName).setRendered(false);
hideButton.setRendered(false);
AdfFacesContext.getCurrentInstance().addPartialTarget(toolbarRefresh);
}
public void showButtonClick(ActionEvent actionEvent) {
String bName = getUserInputValue().toLowerCase();
panelTabbedBind1.findComponent(bName).setRendered(true);
hideButton.setRendered(true);
AdfFacesContext.getCurrentInstance().addPartialTarget(toolbarRefresh);
}
public void setHideButton(RichButton hideButton) {
this.hideButton = hideButton;
}
public RichButton getHideButton() {
return hideButton;
}
public void setShowButton(RichButton showButton) {
this.showButton = showButton;
}
public RichButton getShowButton() {
return showButton;
}
public void setToolbarRefresh(RichToolbar toolbarRefresh) {
this.toolbarRefresh = toolbarRefresh;
}
public RichToolbar getToolbarRefresh() {
return toolbarRefresh;
}
public void setEmployeeTable(RichTable employeeTable) {
this.employeeTable = employeeTable;
}
public RichTable getEmployeeTable() {
return employeeTable;
}
public String singleSelectTable() {
JUCtrlHierNodeBinding rowdata = (JUCtrlHierNodeBinding)this.employeeTable.getRowData();
System.out.println("First Name : " + rowdata.getCurrentRow().getAttribute("FirstName").toString());
System.out.println("Employee Id : " + rowdata.getCurrentRow().getAttribute("EmployeeId").toString());
return null;
}
public String singleSelectTableWithIterator() {
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcItteratorBindings = bindings.findIteratorBinding("EmployeeVOIterator");
ViewObject employeeTableData = dcItteratorBindings.getViewObject();
Row employeeRow = employeeTableData.getCurrentRow();
System.out.println("First Name : " + employeeRow.getAttribute("FirstName"));
System.out.println("Employee Id : " + employeeRow.getAttribute("EmployeeId"));
return null;
}
public String b4()
{
// Get the instance for table component in backing bean
UIXTable table = getEmployeeTable();
// Get the Selected Row key set iterator
Iterator selectionIt = table.getSelectedRowKeys().iterator();
while(selectionIt.hasNext()){
Object rowKey = selectionIt.next();
table.setRowKey(rowKey);
int index = table.getRowIndex();
FacesCtrlHierNodeBinding row =
(FacesCtrlHierNodeBinding) table.getRowData(index);
Row selectedRow = row.getRow();
System.out.println("First Name : " + selectedRow.getAttribute("FirstName"));
System.out.println("Employee Id : " + selectedRow.getAttribute("EmployeeId"));
}
return null;
}
public String b5() {
// Get the instance for table component in backing bean
UIXTable table = getEmployeeTable();
// Get the Selected Row key set iterator
Iterator selectionIt = table.getSelectedRowKeys().iterator();
while(selectionIt.hasNext()){
Object rowKey = selectionIt.next();
table.setRowKey(rowKey); int index = table.getRowIndex();
FacesCtrlHierNodeBinding row = (FacesCtrlHierNodeBinding) table.getRowData(index);
Row selectedRow = row.getRow();
}
return null;
}
}
package view;
import java.util.Iterator;
import javax.faces.component.UIComponent;
import javax.faces.event.ActionEvent;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.rich.component.UIXTable;
import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.layout.RichPanelTabbed;
import oracle.adf.view.rich.component.rich.layout.RichShowDetailItem;
import oracle.adf.view.rich.component.rich.layout.RichToolbar;
import oracle.adf.view.rich.component.rich.nav.RichButton;
import oracle.adf.view.rich.component.rich.output.RichOutputText;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adfinternal.view.faces.model.binding.FacesCtrlHierNodeBinding;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
import oracle.jbo.uicli.binding.JUCtrlHierNodeBinding;
import org.apache.myfaces.trinidad.event.DisclosureEvent;
public class View4 {
private String userInputValue;
private String userOutputValue;
private String gbName;
private RichOutputText outputText;
private RichPanelTabbed panelTabbedBind1;
private RichShowDetailItem tab1;
private RichShowDetailItem tab2;
private RichShowDetailItem tab3;
private RichShowDetailItem tab4;
private RichShowDetailItem tab5;
private RichShowDetailItem tab6;
private RichShowDetailItem tab7;
private RichShowDetailItem tab8;
private RichShowDetailItem tab9;
private RichPanelTabbed panelTabbedBind2;
private RichPanelTabbed panelTabbedBind3;
private RichButton hideButton;
private RichButton showButton;
private RichToolbar toolbarRefresh;
private RichTable employeeTable;
public View4() {
}
public void setUserInputValue(String userInputValue) {
this.userInputValue = userInputValue;
}
public String getUserInputValue() {
return userInputValue;
}
public void setUserOutputValue(String userOutputValue) {
this.userOutputValue = userOutputValue;
}
public String getUserOutputValue() {
return userOutputValue;
}
public void testButtonClick(ActionEvent actionEvent) {
System.out.println("**** testButtonClick ****");
String bName = getUserInputValue();
System.out.println("*** User Given BName=" + bName);
gbName = bName;
setUserOutputValue(bName);
AdfFacesContext.getCurrentInstance().addPartialTarget(outputText);
}
public void setOutputText(RichOutputText outputText) {
this.outputText = outputText;
}
public RichOutputText getOutputText() {
return outputText;
}
public void TabButtonClick(ActionEvent actionEvent) {
System.out.println("**** TabButtonClick ****");
String bName = getUserInputValue();
System.out.println("*** User Given BName=" + bName);
RichShowDetailItem Tabbutton = getTab1();
if (bName.equalsIgnoreCase("Tab1"))
Tabbutton = getTab1();
else if (bName.equalsIgnoreCase("Tab2"))
Tabbutton = getTab2();
else if (bName.equalsIgnoreCase("Tab3"))
Tabbutton = getTab3();
else if (bName.equalsIgnoreCase("Tab4"))
Tabbutton = getTab4();
else if (bName.equalsIgnoreCase("Tab5"))
Tabbutton = getTab5();
else if (bName.equalsIgnoreCase("Tab6"))
Tabbutton = getTab6();
else if (bName.equalsIgnoreCase("Tab7"))
Tabbutton = getTab7();
else if (bName.equalsIgnoreCase("Tab8"))
Tabbutton = getTab8();
else if (bName.equalsIgnoreCase("Tab9"))
Tabbutton = getTab9();
setDisclosedTab(Tabbutton);
}
public void setDisclosedTab(RichShowDetailItem tabBind) {
String statusFlag = "NotSelected";
//RichShowDetailItem RichtabBind11=getTab1();
RichPanelTabbed richPanelTabbed = null;
String tabBindText=tabBind.getClientId().toString();
System.out.println("*** tabBindText ="+tabBindText);
//System.out.println(Str.matches("(.*)com"));
if(tabBindText.matches("(.*)tab1") || tabBindText.matches("(.*)tab2") ||
tabBindText.matches("(.*)tab3")|| tabBindText.matches("(.*)tab4"))
{
richPanelTabbed = getPanelTabbedBind3();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (!sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
richPanelTabbed = getPanelTabbedBind2();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (!sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
richPanelTabbed = getPanelTabbedBind1();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
}
if(tabBindText.matches("(.*)tab5") || tabBindText.matches("(.*)tab6")
|| tabBindText.matches("(.*)tab7"))
{
richPanelTabbed = getPanelTabbedBind3();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (!sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
richPanelTabbed = getPanelTabbedBind2();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
richPanelTabbed = getPanelTabbedBind1();
RichShowDetailItem showDetailsTab2=getTab2();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if(sdi.getClientId().equals(showDetailsTab2.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
}
if(tabBindText.matches("(.*)tab8") || tabBindText.matches("(.*)tab9"))
{
richPanelTabbed = getPanelTabbedBind2();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (!sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
richPanelTabbed = getPanelTabbedBind3();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
richPanelTabbed = getPanelTabbedBind1();
RichShowDetailItem showDetailsTab2=getTab3();
for (UIComponent child : richPanelTabbed.getChildren())
{
RichShowDetailItem sdi = (RichShowDetailItem) child;
if(sdi.getClientId().equals(showDetailsTab2.getClientId()))
sdi.setDisclosed(true);
else
sdi.setDisclosed(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
}
}
public void setDisclosedTab1(RichShowDetailItem tabBind) {
String statusFlag = "NotSelected";
RichPanelTabbed richPanelTabbed = null;
richPanelTabbed = getPanelTabbedBind1();
for (UIComponent child : richPanelTabbed.getChildren()) {
System.out.println("child Tabbed1=" + child.getClientId().toString());
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId())) {
sdi.setDisclosed(true);
statusFlag = "Selected";
} else {
sdi.setDisclosed(false);
}
}
if (statusFlag.equalsIgnoreCase("Selected"))
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
else if (statusFlag.equalsIgnoreCase("NotSelected")) {
richPanelTabbed = getPanelTabbedBind2();
for (UIComponent child : richPanelTabbed.getChildren()) {
System.out.println("child Tabbed2=" + child.getClientId().toString());
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId())) {
sdi.setDisclosed(true);
statusFlag = "Selected";
} else
sdi.setDisclosed(false);
if (statusFlag.equalsIgnoreCase("Selected")) {
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
}
}
} else if (statusFlag.equalsIgnoreCase("NotSelected")) {
richPanelTabbed = getPanelTabbedBind3();
for (UIComponent child : richPanelTabbed.getChildren()) {
System.out.println("child Tabbed3=" + child.getClientId().toString());
RichShowDetailItem sdi = (RichShowDetailItem) child;
if (sdi.getClientId().equals(tabBind.getClientId())) {
sdi.setDisclosed(true);
statusFlag = "Selected";
} else
sdi.setDisclosed(false);
if (statusFlag.equalsIgnoreCase("Selected")) {
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
}
}
}
}
public void setPanelTabbedBind1(RichPanelTabbed panelTabbedBind1) {
this.panelTabbedBind1 = panelTabbedBind1;
}
public RichPanelTabbed getPanelTabbedBind1() {
return panelTabbedBind1;
}
public void showpanelTabbed1DisListener1(DisclosureEvent disclosureEvent)
{
System.out.println("Select Tab String="+disclosureEvent.getComponent().getClientId().toString());
System.out.println("Select Tab String Heading="+disclosureEvent.getComponent()
.getAttributes()
.get("text"));
String SelectedTabBindStr=disclosureEvent.getComponent().getClientId().toString();
RichShowDetailItem Tabbutton=getTab1();
if (disclosureEvent.isExpanded())
{
if(SelectedTabBindStr.matches("(.*)tab1"))
Tabbutton = getTab1();
else if(SelectedTabBindStr.matches("(.*)tab2"))
Tabbutton = getTab2();
else if(SelectedTabBindStr.matches("(.*)tab3"))
Tabbutton = getTab3();
else if(SelectedTabBindStr.matches("(.*)tab4"))
Tabbutton = getTab4();
else if(SelectedTabBindStr.matches("(.*)tab5"))
Tabbutton = getTab5();
else if(SelectedTabBindStr.matches("(.*)tab6"))
Tabbutton = getTab6();
else if(SelectedTabBindStr.matches("(.*)tab7"))
Tabbutton = getTab7();
else if(SelectedTabBindStr.matches("(.*)tab8"))
Tabbutton = getTab8();
else if(SelectedTabBindStr.matches("(.*)tab9"))
Tabbutton = getTab9();
}
setDisclosedTab(Tabbutton);
}
public void showpanelTabbed1DisListener(DisclosureEvent disclosureEvent) {
String SelectedTabBindStr=disclosureEvent.getComponent().getClientId().toString();
System.out.println("*** SelectedTabBindStr="+SelectedTabBindStr);
if (disclosureEvent.isExpanded()) {
// The below code will return the selected tab name.
System.out.println("Select Tab String="+disclosureEvent.getComponent().getClientId().toString());
System.out.println("Select Tab String Heading="+disclosureEvent.getComponent()
.getAttributes()
.get("text"));
String selTab = disclosureEvent.getComponent()
.getAttributes()
.get("text")
.toString();
if (selTab.equalsIgnoreCase("Tab Label 1")) {
tab1.setDisclosed(true);
tab2.setDisclosed(false);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 2")) {
tab1.setDisclosed(false);
tab2.setDisclosed(true);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(true);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 3")) {
tab1.setDisclosed(false);
tab2.setDisclosed(false);
tab3.setDisclosed(true);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 4")) {
tab1.setDisclosed(false);
tab2.setDisclosed(false);
tab3.setDisclosed(false);
tab4.setDisclosed(true);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 5")) {
tab1.setDisclosed(false);
tab2.setDisclosed(true);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(true);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 6")) {
tab1.setDisclosed(false);
tab2.setDisclosed(true);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(true);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 7")) {
tab1.setDisclosed(false);
tab2.setDisclosed(true);
tab3.setDisclosed(false);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(true);
tab8.setDisclosed(false);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 8")) {
tab1.setDisclosed(false);
tab2.setDisclosed(false);
tab3.setDisclosed(true);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(true);
tab9.setDisclosed(false);
} else if (selTab.equalsIgnoreCase("Tab Label 9")) {
tab1.setDisclosed(false);
tab2.setDisclosed(false);
tab3.setDisclosed(true);
tab4.setDisclosed(false);
tab5.setDisclosed(false);
tab6.setDisclosed(false);
tab7.setDisclosed(false);
tab8.setDisclosed(false);
tab9.setDisclosed(true);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind1);
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind2);
AdfFacesContext.getCurrentInstance().addPartialTarget(panelTabbedBind3);
}
}
public void setTab1(RichShowDetailItem tab1) {
this.tab1 = tab1;
}
public RichShowDetailItem getTab1() {
return tab1;
}
public void setTab2(RichShowDetailItem tab2) {
this.tab2 = tab2;
}
public RichShowDetailItem getTab2() {
return tab2;
}
public void setTab3(RichShowDetailItem tab3) {
this.tab3 = tab3;
}
public RichShowDetailItem getTab3() {
return tab3;
}
public void setTab4(RichShowDetailItem tab4) {
this.tab4 = tab4;
}
public RichShowDetailItem getTab4() {
return tab4;
}
public void setTab5(RichShowDetailItem tab5) {
this.tab5 = tab5;
}
public RichShowDetailItem getTab5() {
return tab5;
}
public void setTab6(RichShowDetailItem tab6) {
this.tab6 = tab6;
}
public RichShowDetailItem getTab6() {
return tab6;
}
public void setTab7(RichShowDetailItem tab7) {
this.tab7 = tab7;
}
public RichShowDetailItem getTab7() {
return tab7;
}
public void setTab8(RichShowDetailItem tab8) {
this.tab8 = tab8;
}
public RichShowDetailItem getTab8() {
return tab8;
}
public void setTab9(RichShowDetailItem tab9) {
this.tab9 = tab9;
}
public RichShowDetailItem getTab9() {
return tab9;
}
public void setPanelTabbedBind2(RichPanelTabbed panelTabbedBind2) {
this.panelTabbedBind2 = panelTabbedBind2;
}
public RichPanelTabbed getPanelTabbedBind2() {
return panelTabbedBind2;
}
public void setPanelTabbedBind3(RichPanelTabbed panelTabbedBind3) {
this.panelTabbedBind3 = panelTabbedBind3;
}
public RichPanelTabbed getPanelTabbedBind3() {
return panelTabbedBind3;
}
public void hideButtonClick(ActionEvent actionEvent) {
String bName = getUserInputValue().toLowerCase();
panelTabbedBind1.findComponent(bName).setRendered(false);
hideButton.setRendered(false);
AdfFacesContext.getCurrentInstance().addPartialTarget(toolbarRefresh);
}
public void showButtonClick(ActionEvent actionEvent) {
String bName = getUserInputValue().toLowerCase();
panelTabbedBind1.findComponent(bName).setRendered(true);
hideButton.setRendered(true);
AdfFacesContext.getCurrentInstance().addPartialTarget(toolbarRefresh);
}
public void setHideButton(RichButton hideButton) {
this.hideButton = hideButton;
}
public RichButton getHideButton() {
return hideButton;
}
public void setShowButton(RichButton showButton) {
this.showButton = showButton;
}
public RichButton getShowButton() {
return showButton;
}
public void setToolbarRefresh(RichToolbar toolbarRefresh) {
this.toolbarRefresh = toolbarRefresh;
}
public RichToolbar getToolbarRefresh() {
return toolbarRefresh;
}
public void setEmployeeTable(RichTable employeeTable) {
this.employeeTable = employeeTable;
}
public RichTable getEmployeeTable() {
return employeeTable;
}
public String singleSelectTable() {
JUCtrlHierNodeBinding rowdata = (JUCtrlHierNodeBinding)this.employeeTable.getRowData();
System.out.println("First Name : " + rowdata.getCurrentRow().getAttribute("FirstName").toString());
System.out.println("Employee Id : " + rowdata.getCurrentRow().getAttribute("EmployeeId").toString());
return null;
}
public String singleSelectTableWithIterator() {
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcItteratorBindings = bindings.findIteratorBinding("EmployeeVOIterator");
ViewObject employeeTableData = dcItteratorBindings.getViewObject();
Row employeeRow = employeeTableData.getCurrentRow();
System.out.println("First Name : " + employeeRow.getAttribute("FirstName"));
System.out.println("Employee Id : " + employeeRow.getAttribute("EmployeeId"));
return null;
}
public String b4()
{
// Get the instance for table component in backing bean
UIXTable table = getEmployeeTable();
// Get the Selected Row key set iterator
Iterator selectionIt = table.getSelectedRowKeys().iterator();
while(selectionIt.hasNext()){
Object rowKey = selectionIt.next();
table.setRowKey(rowKey);
int index = table.getRowIndex();
FacesCtrlHierNodeBinding row =
(FacesCtrlHierNodeBinding) table.getRowData(index);
Row selectedRow = row.getRow();
System.out.println("First Name : " + selectedRow.getAttribute("FirstName"));
System.out.println("Employee Id : " + selectedRow.getAttribute("EmployeeId"));
}
return null;
}
public String b5() {
// Get the instance for table component in backing bean
UIXTable table = getEmployeeTable();
// Get the Selected Row key set iterator
Iterator selectionIt = table.getSelectedRowKeys().iterator();
while(selectionIt.hasNext()){
Object rowKey = selectionIt.next();
table.setRowKey(rowKey); int index = table.getRowIndex();
FacesCtrlHierNodeBinding row = (FacesCtrlHierNodeBinding) table.getRowData(index);
Row selectedRow = row.getRow();
}
return null;
}
}