GetDetailHrefOptions

Description

This JSP function is typically used to form a link in an inner panel that opens another detail view. A link is modeled as a resource of type Link. The resource can point to any other detail view, and you can configure this through the Resource Hierarchy tree. Use this function inside an <a> tag. This function can be used only in an inner panel (and therefore only in a detail view).

Syntax

String getDetailHrefOptions(String linkIdSuffix, String entityKey, String extraParams)

Input parameters

linkIdSuffix - Required. Link ID suffix. A resource of type Link is named as <current inner panel's Resource ID><suffix>. For instance, if the current inner panel's Resource ID is YOMD010I01, a link ID is YOMD010I01L01 and the suffix is L01. Pass only the suffix L01.

entityKey - Required. Key (formed through the makeXMLInput JSP tag) that must be passed on to the view that is invoked by selecting this link.

extraParams - Required. String containing extra parameters that are appended to the URL that is formed for the <a href> tag. The String should start with an ampersand ("&") and should contain name-value pairs in the name=value format. Restrict the use of this parameter only to cases where it is absolutely necessary because there is a size limit of what can be passed in a URL. Typically, each view should only take the key and retrieve other details from an API based on that key.

Output parameters

A string containing href="" and onclick="" attributes must be plugged into an <a> tag in HTML.

The resource of type link is not permission controlled. However, the view to which a link points is permission controlled. Still, since this function is called inside an <a> tag, the link is formed regardless of whether or not the user has permissions for the view to which the link points. If the user selects the link, the view that is displayed gives an Access Denied message.

Example

This example shows how the getDetailHrefOptions() function forms a hyperlink to the Alert Detail view from a list of alerts for an order.

<table class="table" editable="false" width="100%" cellspacing="0">
 <thead> 
   <tr>
     <td sortable="no" class="checkboxheader">
        <input type="checkbox" name="checkbox" value="checkbox" 
onclick="doCheckAll(this);"/>
      </td>
      <td class="tablecolumnheader"><yfc:i18n>Alert_ID</yfc:i18n>
      </td>
   </tr>
 </thead>
 <tbody>
   <yfc:loopXML binding="xml:/InboxList/@Inbox" id="Inbox">
   <tr>
      <yfc:makeXMLInput name="inboxKey">
      <yfc:makeXMLKey binding="xml:/Inbox/@InboxKey" 
value="xml:/Inbox/@InboxKey"/>
      </yfc:makeXMLInput>
      <td> 
         <input type="checkbox" value='<%=
getParameter("inboxKey")%>' name="EntityKey"/>
      </td>
      <td class="tablecolumn">
          <a <%=getDetailHrefOptions("L01", getParameter("inboxKey"),"")%>
              <yfc:getXMLValue binding="xml:/Inbox/@InboxKey"/>
          </a>
       </td>
   </tr>
   </yfc:loopXML>
 </tbody> 
</table>