Using the override entity key attribute
Often, optimal screen layout dictates the use of an editable list of records. This table format usually maps to a list of XML elements in the API that handles the update for the screen. For example, the editable list of order lines on an Order Detail screen maps to the list of OrderLine elements accepted by the getOrderDetails() API.
By default, any action that appears on a detail view uses the current entity key as input to any API that is called for the action. For example, the Hold action on the Order Detail screen by default passes the current order header key to the changeOrder() API. You can override the entity key used for a specific action using the Override Entity Key attribute on an action resource. To construct an input (usually a hidden input or a checkbox) on the JSP, give the input the value of an entity key constructed using the makeXMLInput JSP tag, and specify the name of that input as the Entity Key Name of the action. When that action is invoked by the user, the new key is passed instead of the current entity key.
This feature is useful when a detail view shows the details of one entity and also contains an inner panel that displays a list of records for another entity. For example, the Order Detail screen shows details for the Order entity and also has an inner panel showing a list of order lines (which is a separate entity). Any action that appears on the order lines inner panel should not pass the order header key to the API. It should pass the order line key of the selected order lines.
For example, the following code might appear in an inner panel that lists order lines for an order:
<yfc:makeXMLInput name="orderLineKey">
<yfc:makeXMLKey binding="xml:/OrderLineDetail/@OrderLineKey"
value="xml:/OrderLine/@OrderLineKey"/>
<yfc:makeXMLKey binding="xml:/OrderLineDetail/@OrderHeaderKey"
value="xml:/Order/@OrderHeaderKey"/>
</yfc:makeXMLInput>
<td class="checkboxcolumn" >
<input type="checkbox" value='<%=getParameter("orderLineKey")%>'
name="chkEntityKey"/>
</td>
This code creates a new entity key for the order line and associates this key to a checkbox named chkEntityKey. This name can then be specified in the action definition for any action appearing on the order lines inner panel, for example, the View Details action.
Note that this attribute frequently is used in conjunction with the Selection Key Name attribute that also can be defined for an action.