1 package com.teamkonzept.field; 2 3 import com.teamkonzept.lib.*; 4 import com.teamkonzept.publishing.markups.*; 5 import com.teamkonzept.web.*; 6 import com.teamkonzept.field.db.*; 7 8 public class TKAtomFieldShowIterator implements TKListIterator { 9 10 TKListIterator oldIterator; 11 String listName; 12 TKVector valueList; 13 14 public TKAtomFieldShowIterator( 15 TKVector valueList, 16 TKListIterator oldIterator, 17 String listName 18 ) 19 { 20 this.oldIterator = oldIterator; 21 this.listName = listName; 22 this.valueList = valueList; 23 } 24 25 public boolean apply( TKTemplate t, int i, String currListName ) 26 { 27 TKHTMLTemplate template = (TKHTMLTemplate) t; 28 if( currListName.equalsIgnoreCase( listName ) ) { 29 if( i >= valueList.size() ) return false; 30 Object value = valueList.get(i); 31 template.set( "SCOPE", listName ); 32 template.set( listName+".ITEM", value ); 33 template.set( listName+".IDX", String.valueOf(i+1) ); 34 return true; 35 } 36 else if( oldIterator != null ) { 37 return oldIterator.apply( template, i, currListName ); 38 } 39 else { 40 return false; 41 } 42 } 43 } 44 45 46 | Popular Tags |