跳至内容

WebObjects/Web 应用程序/开发/示例/列表组件

来自 Wikibooks,开放世界的开放图书

因此,您有一个标题和一个对象“列表”。该列表有要显示的对象的最小和最大数量。如果有“太多”对象,则有“更多...”链接。

以下为 html

  <webobject name="HasData">
    <webobject name="Title"></webobject>
    <br>
    <webobject name="Items">
      <webobject name = "Item"></webobject><br>
    </webobject>
    <webobject name="HasMore">
      <webobject name = "MoreLink"><span class = "Label"><small><webobject name = "MoreCount"></webobject> more...</small></span></webobject><br>
    </webobject>
    <div class = "Space"></div>
  </webobject>

以下为 wod

 HasData: WOConditional {
   condition = hasData;
 };
 
 Title: SpanString {
   value = title.toUpperCase;
   isSmall = true;
   isBold = true;
   class = "Label";
 };
 
 Items: WORepetition {
   count = count;
   index = index;
 };
 
 Item: SZLink {
   value = item;
   description = description;
   altDescription = altDescription;
   href = href;
   pageName = pageName;
   isSmall = true;
   class = "Label";
 };
 
 HasMore: WOConditional {
   condition = hasMore;
 };
 
 MoreCount: SpanString {
   value = moreCount;
 };
 
 MoreLink: WOHyperlink {
   action = displayMore;
 };
华夏公益教科书