package flexa.ff;

import flexa.fb.*;
import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;


public class tr extends FComponent {
    
    OQL datasourceOql = null;
    
    public tr() {
        super("ff.tr");
    }

	public void updateFromRequest(HashMap<String, Object> aParameters) throws Exception {
	    //if( aParameters.containsKey(this.getValue("name")) )
        //    this.setValue("value", aParameters.get(this.getValue("name")).toString());
	}  
	

    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);
		}
    }


}