WebObjects/Web 应用程序/开发/示例/字母表
外观
字母表只是按字母顺序显示其元素的列表……当一个批处理中元素过多时,还有一些分页(未显示)。如果必要,分页在运行时按字母顺序完成,例如 A-D E-Z。
以下是 HTML
<webobject name = "HasData"> <webobject name = "Table"> <tr> <td align = "left" valign = "top" colspan = "3"> <div class = "Line"></div> <webobject name = "ItemDescription"></webobject> <webobject name = "HasBatches"> <span class = "Label"><small> | </small></span> <webobject name = "Batches"> <webobject name = "IsCurrentBatch"> <webobject name = "Batch"></webobject> </webobject> <webobject name = "IsNotCurrentBatch"> <webobject name = "BatchLink"><webobject name = "Batch"></webobject></webobject> </webobject> </webobject> </webobject> <div class = "Line"></div><br> </td> </tr> <tr> <webobject name = "Columns"> <td align = "left" valign = "top"> <webobject name = "Rows"> <webobject name = "HasHref"> <webobject name = "HrefLink"><webobject name = "Prefix"></webobject><webobject name = "Suffix"></webobject></webobject> </webobject> <webobject name = "HasNoHref"> <webobject name = "Link"><webobject name = "Prefix"></webobject><webobject name = "Suffix"></webobject></webobject> </webobject> <div class = "Space"></div> </webobject> </td> </webobject> </tr> <webobject name = "HasBatches"> <tr> <td align = "left" valign ="top"> <webobject name = "PreviousLink"><webobject name = "Previous"></webobject></webobject> </td> <td align = "left" valign = "top"> </td> <td align = "right" valign ="top"> <webobject name = "NextLink"><webobject name = "Next"></webobject></webobject> </td> </tr> </webobject> </webobject> </webobject>
以及 wod
HasData: WOConditional{ condition = hasData; }; Table: WOGenericContainer{ elementName = "table"; border = "0"; cellSpacing = "3"; cellPadding = "0"; }; ItemDescription: SpanString{ value = itemDescription; isSmall = true; class = "Label"; }; HasBatches: WOConditional{ condition = hasBatches; }; Batches: WORepetition{ count = batchCount; index = batchIndex; }; Batch: SpanString{ value = batchLabel; isItalic = isCurrentBatch; isSmall = true; class = "Label"; }; IsCurrentBatch: WOConditional{ condition = isCurrentBatch; }; IsNotCurrentBatch: WOConditional{ condition = isCurrentBatch; negate = true; }; BatchLink: WOHyperlink{ action = displayBatch; }; Rows: WORepetition{ count = rowCount; index = rowIndex; }; Columns: WORepetition{ count = columnCount; index = columnIndex; }; Prefix: SpanString{ value = prefix; isBold = shouldBreak; class = "Text"; }; Suffix: SpanString{ value = suffix; class = "Text"; }; ShouldBreak: WOConditional{ condition = shouldBreak; }; Link: WOHyperlink{ action = displayItem; title = altDescription; }; HasHref: WOConditional{ condition = hasHref; }; HasNoHref: WOConditional{ condition = hasHref; negate = true; }; HrefLink: WOHyperlink{ href = href; title = altDescription; target = "SZLink"; }; PreviousLink: WOHyperlink{ action = displayPrevious; }; Previous: SpanString{ value = "<PREVIOUS"; isSmall = true; class = "Label"; }; NextLink: WOHyperlink{ action = displayNext; }; Next: SpanString{ value = "NEXT>"; isSmall = true; class = "Label"; };
与往常一样,组件实现留给读者想象。