YfcSplitLine
Description
This JavaScript function splits a specific row into two rows.
Syntax
yfcSplitLine(imageNode)
Input parameters
imageNode - Required. Object pointer to the image that is selected in response to which this function is called.
Output parameters
None.
The following table lists the attributes to use at each cell level for determining the behavior of the newly created rows.
| Attribute | Behavior |
|---|---|
| ShouldCopy | Determines whether or not to copy the contents of the cell, including child cells. If specified as true, the contents are copied. If specified as false, the contents are not copied and an empty cell is created. Defaults to false. |
| NewName | Determines whether a new cell acquires an automatically
generated name. The generated name is derived from the name and row
count of the current object being copied. If specified as true, the
new cell acquires a new name. If specified as false, no name is generated.
Defaults to false. The name generating logic requires that the original
name contain "_integer" at the spot where the row
count must be inserted. For example, if the original name is xml:/InspectOrder/ReceiptLines/FromReceiptLine_1/@ReceiptLineNo,
the new row has an object with the name as xml:/InspectOrder/ReceiptLines/FromReceiptLine_2/@ReceiptLineNo. |
| NewClassName | Class of the new copy of the object. For example,
if the class of the original object is unprotectedinput,
but if you want the new copy to be protected, specify the new class
as protectedinput. If not used, the class of the original object is
used in the copy. |
| NewDisabled | Determines whether or not controls are created
in a disabled state. For some HTML controls (such as <img> tags),
this means disabling all actions on the control. If specified as true,
the property named disabled is set to true. If specified
as false, the disabled property is not be set. Defaults to false. |
| NewResetValue | Determines the state of the value attribute for the new object. If this is set to true, the new object's value attribute is voided. For most HTML controls, this results in the contents of the control being blanked out. If specified as false, the value of the original control is set in the copy. Defaults to false. |
| NewContentEditable | Optional. Determines whether or not the new object inherits the ContentEditable property of the current object. If this is specified, the ContentEditable property of the current object also becomes the new object's ContentEditable property. For some HTML controls (such as text box), this property controls whether or not the control is editable. The value you specify becomes the value set in the ContentEditable attribute in the copy. If this is not specified, the new object inherits the current object's ContentEditable property. |
| NewTRClassName | Optional. Specify the class of a new row that
is formed after a line split. If this attribute is not passed, the
default behavior is seen. For example, if a <tr> had classname="oddrow" specified
as the class and you want to retain the same class in the new row
after a line split, then instead of <tr classname="oddrow"> the
JSP should contain <tr classname="oddrow" NewTRClassName
= "oddrow">. |
Example
This example shows how you can split a line on the client side during returns inspection so that a specific receipt line can be given multiple dispositions.
<yfc:loopXML binding="xml:/ReceiptLines/@ReceiptLine" id="ReceiptLine">
<tr>
<yfc:makeXMLInput name="receiptLineKey">
<yfc:makeXMLKey binding="xml:/ReceiptLine/@ReceiptLineKey"
value="xml:/ReceiptLine/@ReceiptLineKey"/>
</yfc:makeXMLInput>
<td class="checkboxcolumn" ShouldCopy="false" nowrap="true">
<input type="checkbox" value='<%=getParameter("receiptLineKey")%>'
name="chkEntityKey"/>
</td>
<td class="checkboxcolumn" nowrap="true" ShouldCopy="false" >
<img class="columnicon" <%=getImageOptions
(YFSUIBackendConsts.RECEIPT_LINE_HISTORY,"Disposition_History")%>></a>
</td>
<td class="tablecolumn" nowrap="true" ShouldCopy="false">
<yfc:getXMLValue binding="xml:/ReceiptLine/@SerialNo"/></td>
<td class="tablecolumn" nowrap="true" ShouldCopy="false">
<yfc:getXMLValue binding="xml:/ReceiptLine/@LotNumber"/></td>
<td class="tablecolumn" nowrap="true" ShouldCopy="false">
<yfc:getXMLValue binding="xml:/ReceiptLine/@ShipByDate"/></td>
<td class="numerictablecolumn" nowrap="true" ShouldCopy="false">
<yfc:getXMLValue binding="xml:/ReceiptLine/@AvailableForTranQuantity"/></td>
<td class="tablecolumn" nowrap="true" ShouldCopy="false">
<yfc:getXMLValue binding="xml:/ReceiptLine/@DispositionCode"/></td></td>
<td class="tablecolumn" ShouldCopy="false" >
<yfc:getXMLValue binding="xml:/ReceiptLine/@InspectionComments"/>
</td>
<td class="tablecolumn" nowrap="true" ShouldCopy="true" >
<img IconName="addSplitLine" src="../console/icons/add.jpg"
<% if
(getNumericValue("xml:/ReceiptLine/@AvailableForTranQuantity") > 1) { %>
class="lookupicon" onclick="yfcSplitLine(this)"
<%} else {%>
style="filter:progid:DXImageTransform.Microsoft.BasicImage(grayScale=1)"
<%}%>
/>
<input type="hidden"
<%=getTextOptions("xml:/InspectOrder/ReceiptLines/FromReceiptLine_" +
ReceiptLineCounter + "/@ReceiptHeaderKey",
"xml:/ReceiptLine/@ReceiptHeaderKey")%>/>
<input type="hidden"
<%=getTextOptions("xml:/InspectOrder/ReceiptLines/FromReceiptLine_" +
ReceiptLineCounter + "/@ReceiptLineNo",
"xml:/ReceiptLine/@ReceiptLineNo")%>/>
<select NewName="true" NewClassName="unprotectedinput"
NewContentEditable="true" NewResetValue="true" class="combobox"
<%=getComboOptions("xml:/InspectOrder/ReceiptLines/FromReceiptLine_" +
ReceiptLineCounter + "/ToReceiptLines/ToReceiptLine_1/@DispositionCode")%>>
<yfc:loopOptions binding="xml:/ReturnDispositionList/
@ReturnDisposition" name="Description" value="DispositionCode"
selected="xml:/ReceiptLine/@DispositionCode"/>
</select>
</td>
<td class="tablecolumn" nowrap="true" ShouldCopy="true" >
<input type="text" NewName="true" ewClassName="numericunprotectedinput"
NewContentEditable="true" NewResetValue="true"
class="numericunprotectedinput"
<%=getTextOptions("xml:/InspectOrder/ReceiptLines/FromReceiptLine_" +
ReceiptLineCounter + "/ToReceiptLines/ToReceiptLine_1/@Quantity", "")%>/>
</td>
<td class="tablecolumn" nowrap="true" ShouldCopy="true" >
<input type="text" NewName="true" NewClassName="unprotectedinput"
NewContentEditable="true" NewResetValue="true" class="unprotectedinput"
<%=getTextOptions("xml:/InspectOrder/ReceiptLines/FromReceiptLine_" +
ReceiptLineCounter + "/ToReceiptLines/ToReceiptLine_1/@InspectionComments",
"")%>/>
</td>
</tr>
</yfc:loopXML>
</tbody>