跳至內容

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;
 };
華夏公益教科書