Customizing screen navigation

You can customize how users navigate from entity to entity by configuring link or action resources. Links and actions can point to any detail view of any entity. Often the entity that you are navigating to requires a different entity key

For example, the Order Detail screen has a list of order lines. Users can navigate to the order line detail screen by clicking the Order Line # hyperlink, or by selecting an order line and clicking the View Details action on the order line's inner panel. Since the order line detail screen requires a different entity key than the Order Detail screen, it is necessary to create another entity key in the order line's JSP to be used in the order line detail screen.

Example 10–3 shows sample code for specifying screen navigation behavior.

	<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>

The way this entity key is passed to the order line detail screen differs for the hyperlink and action routes. For the hyperlink, this key is passed to the getDetailHrefOptions() function in the following manner:

	<a <%=getDetailHrefOptions("L03", getParameter("orderLineKey"), "")%>>
	   <yfc:getXMLValue binding="xml:/OrderLine/@PrimeLineNo"/></a>

Sometimes you might want a detail view to behave differently based on some input parameter. For example, you might want to hide or show a field in a detail view based on the parameter which is invoking the detail view.

You can call the getDetailHrefOptions() JSP function, using extra parameters that are passed to the target detail view.

The required format to pass these extra parameters should have name-value pairs separated by an ampersand ("&"). This is the standard format for passing parameters in a URL.

For the View Details action, the Selection Key Name must be set to the name of the checkbox created in the JSP. For example, in the JSP, the checkbox can be created as follows:

<input type="checkbox" value='<%=getParameter("orderLineKey")%>' 
name="chkEntityKey"/>

The name of the checkbox is chkEntityKey. When configuring the action in the Resource Hierarchy tree, the Selection Key Name should be set to this to ensure the correct key is passed to the order line detail screen.