YfcDisplayOnlySelectedLines

Description

This JavaScript function is for situations when the user needs to select multiple records from a list in screen A and those records must be passed on to screen B. In screen B, the selected records are displayed, possibly with additional information for each record. In such cases, the logic is that the same set of APIs that were used to build screen A could be called to also build screen B, and on the client side, a filtration process limits the display to only those selected in screen A.

This function requires that each row in the table that is under consideration must have an attribute called yfcSelectionKey set to the URL encoded XML (formed using yfc:makeXMLInput JSP tag).

Syntax

yfcDisplayOnlySelectedLines(tableId)

Input parameters

tableId - Required. Identifier attribute of the table whose content must be limited to that selected from the previous screen.

Output parameters

None.

Example

The following example shows how the create order line dependency screen limits the results in the order lines list to the specific lines that are selected in the order detail screen. First, this function must be called in the onload event.

<script language="javascript">
   function window.onload() {
     if (!yfcBodyOnLoad() && (!document.all('YFCDetailError'))) {
          return;
     }
     yfcDisplayOnlySelectedLines("DependentLines");
   } 
</script>

Second, each <tr> tag must contain the yfcSelectionKey attribute.

<tbody>
    <yfc:loopXML name="Order" 
binding="xml:/Order/OrderLines/@OrderLine" id="OrderLine">
      <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>
     <tr yfcSelectionKey="<%=getParameter("orderLineKey")%>">
          <td class="tablecolumn"><yfc:getXMLValue
binding="xml:/OrderLine/Item/@ItemID"/></td>
          <td class="tablecolumn"><yfc:getXMLValue
binding="xml:/OrderLine/Item/@ProductClass"/></td>
          <td class="tablecolumn"><yfc:getXMLValue
binding="xml:/OrderLine/Item/@UnitOfMeasure"/></td>
          <td class="tablecolumn"><yfc:getXMLValue
binding="xml:/OrderLine/Item/@ItemDesc"/></td>
     </tr>
     </yfc:loopXML>            
 </tbody>