package flexa.ff;
import flexa.fb.*;
import java.util.Map;
import java.util.HashMap;
import javax.script.*;
public class tr extends FComponent {
    //
    // CONSTRUCTOR
    //
    public tr() {
        super("ff.tr");
    }
    
    // 
    // Methods
    //
    
    
    public void buildFromFRow(FRow row)  throws Exception { 
    		td ttd = null;
		for (String key : row.keySet()) {
		    ttd = new td();
		    String tid = this.id + key;
		    ttd.setValue("id", tid);
		    ttd.setValue("name", tid);
		    Object tval = row.get(key);
		    if( tval != null && tval instanceof FObject ) {
		        tval = ((FObject)tval).getDisplay();
		    }
			ttd.setValue("content", tval);
			this.addChild(ttd);
		}

    }
    


    
    public void buildHeaderFromFRow(FRow row)  { 
    		td ttd = null;
		for (String key : row.keySet()) {
		    ttd = new td();
		    String tid = this.id + key;
		    ttd.setValue("id", tid);
		    ttd.setValue("name", tid);
			ttd.setValue("content", key);
			this.addChild(ttd);
		}

    }
    


    // 
    // Events
    //
	public void event(String aAction, FContext aContext) throws Exception {
        
	    super.event(aAction, aContext);
	}
	
	
	
	
}