Siebel Self-Service Application Developer's Guide > Customizing Menus for Siebel Self-Service Applications >

Using the Condition Property to Hide Detail Nodes in List-Detail Pages


In a typical application:

  • The Orders node shows the list of orders based on a search
  • The Order Details node shows the detail of the order selected in the Orders node
  • The Line Details node shows the details of the line selected in the Order Details node

If there are no results shown in the Orders node (a search returns no rows) the Order Details and Line Details nodes must not be shown. The condition property is used to accomplish this result.

The following example shows the sample code for the Orders, Order Details, and Line Details nodes in faces-config-base-menu.xml:

  <managed-bean>

<managed-bean-name>m3_OrderStatus_Orders</managed-bean-name>

<managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class>

<managed-bean-scope>session</managed-bean-scope>

<managed-property>

<property-name>label</property-name>

<value>Orders</value>

</managed-property>

<managed-property>

<property-name>fileName</property-name>

<value>/faces/ss/base/order/Orders.jspx</value>

</managed-property>

  </managed-bean>

  <managed-bean>

<managed-bean-name>m3_OrderStatus_OrderDetails</managed-bean-name>

<managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class>

<managed-bean-scope>session</managed-bean-scope>

<managed-property>

<property-name>label</property-name>

<value>Order Details</value>

</managed-property>

<managed-property>

<property-name>fileName</property-name>

<value>/faces/ss/base/order/OrderDetails.jspx</value>

</managed-property>

<managed-property>

<property-name>condition</property-name>

<value>orderBean.isOrderDetailsShown</value>

</managed-property>

  </managed-bean>

  <managed-bean>

<managed-bean-name>m3_OrderStatus_LineDetails</managed-bean-name>

<managed-bean-class>oracle.apps.ss.base.view.util.MenuItem</managed-bean-class>

<managed-bean-scope>session</managed-bean-scope>

<managed-property>

<property-name>label</property-name>

<value>Line Details</value>

</managed-property>

<managed-property>

<property-name>fileName</property-name>

<value>/faces/ss/base/order/LineDetails.jspx</value>

</managed-property>

<managed-property>

<property-name>condition</property-name>

<value>orderBean.isLineDetailsShown</value>

</managed-property>

  </managed-bean>

NOTE:  The condition managed property is not set for the Orders node, because it does not depend on the business logic. Only the Order Details and Line Details nodes are hidden if there are no records under the Orders node.

The Java code for orderBean will be similar to the following example:

  public class OrderBean {

public OrderBean() {

}

boolean lineDetailsNode = false;

boolean orderDetailsNode = false;

public void setLineDetailsShown(boolean lineDetailsShown) {

this.lineDetailsShown = lineDetailsShown;

}

public boolean isLineDetailsShown() {

// Check whether one or more results are in the View Object. If yes return true; else return false.

HttpServletRequest httpRequest = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();

BindingContext ctx = DCUtil.getBindingContext(httpRequest);

DCDataControl dc = ctx.findDataControl("SessionAMDataControl");

SessionAMImpl sessionAM = (SessionAMImpl) dc.getDataProvider();

OrderAMImpl ordersAM = (OrderAMImpl)sessionAM.getOrderAM();

ordersVOImpl orderVO = (ordersVOImpl)ordersAM.getordersVO1();

if (orderVO.getFetchedRowCount() != 0) {

return true;

}

else {

return false;

}

}

public void setOrderDetailsShown(boolean orderDetailsShown) {

this.orderDetailsShown = orderDetailsShown;

}

public boolean isOrderDetailsShown() {

// Check whether one or more results are in the View Object. If yes return true; else return false.

HttpServletRequest httpRequest = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();

BindingContext ctx = DCUtil.getBindingContext(httpRequest);

DCDataControl dc = ctx.findDataControl("SessionAMDataControl");

SessionAMImpl sessionAM = (SessionAMImpl) dc.getDataProvider();

OrderAMImpl ordersAM = (OrderAMImpl)sessionAM.getOrderAM();

ordersVOImpl orderVO = (ordersVOImpl)ordersAM.getordersVO1();

if (orderVO.getFetchedRowCount() != 0) {

return true;

}

else {

return false;

}

}

}

Siebel Self-Service Application Developer's Guide Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices.