// generated by FBuilder
package flexa.ff;
import flexa.fb.*;
import java.util.Map;
import java.util.HashMap;
import javax.script.*;
import java.util.ArrayList;
public class record extends FComponent {
    //
    // CONSTRUCTOR
    //
    public record() {
        super("ff.record");
    }
    
    // 
    // Methods
    //
    
    
    public void buildFromFRow(FRow row)  throws Exception { 
    		data ttd = null;
		String lastkey = "";
		for (String key : row.keySet()) {
		    if( key.startsWith("_") ) continue;
		    
		    if( lastkey.endsWith("_display") ) {
		        //Log.info("lastkey " + lastkey + " without " + lastkey.substring(0, lastkey.length() - 8));
		    }
		    if( lastkey.endsWith("_display") && lastkey.substring(0, lastkey.length() - 8).equals(key) ) continue;
		    ttd = new data();
		    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);
			lastkey = key;
		}

    }
    


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