GetNumericValue

Description

This JSP function retrieves a number from an XML output in the original XML format, and not in the format of current locale. This is typically used for storing a custom sortValue attribute in a column for sorting a table.

Syntax

String getNumericValue(String bindingStr)

Input parameters

bindingStr - Required. Binding string that must be resolved into a number string.

Output parameters

Number string in the Sterling Selling and Fulfillment Foundation XML format, with decimals.

Example

This example shows how the getNumericValue() function is used to store the priority in XML format for subsequent client-side sorting by user on the 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>
      <td class="tablecolumnheader"><yfc:i18n>Priority</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>
        <td class="tablecolumn" 
sortValue="<%=getNumericValue("xml:Inbox:/Inbox/@Priority")%>"><yfc:
getXMLValue binding="xml:/Inbox/@Priority"/>
		      </td>
    </tr>
    </yfc:loopXML>
  </tbody> 
</table>