package com.sometrik.framework;

import android.content.Context;
import android.view.View;
import android.widget.TableLayout;
import android.widget.TableRow;

public class FWTable extends TableLayout implements NativeCommandHandler {
  
  Context context;
  int columnCount = 1;
  
  public FWTable(Context context) {
    super(context);
    this.context = context;
    TableRow row = new TableRow(context);
  }
  
  private TableRow getCurrentRow(){
    //TODO
    return new TableRow(context);
  }
  
  public void setColumnCount(int columnCount) { this.columnCount = columnCount; };



@Override
public void addChild(View view) {
//  addRow();
  System.out.println("FWTable couldn't handle addChild command");
}

@Override
public void showView() {
  System.out.println("FWTable couldn't handle showView command");
}

@Override
public void addOption(int position, String text) {
}

@Override
public int getElementId() {
  return getId();
}

@Override
public void removeChild(int id) {
  // TODO Auto-generated method stub
  
}



}

@@ -26,16 +26,45 @@
 ework;%0A%0A
+import java.util.ArrayList;%0A%0A
 import a
@@ -301,16 +301,97 @@
 nt = 1;%0A
+  int rowCounter = 0;%0A  ArrayList%3CTableRow%3E rowList;%0A  ArrayList%3CView%3E dataList;%0A
   %0A  pub
@@ -477,100 +477,338 @@
     
-TableRow row = new TableRow(context);%0A  %7D%0A  %0A  private TableRow getCurrentRow()%7B%0A    //TODO%0A
+rowList = new ArrayList%3CTableRow%3E();%0A    dataList = new ArrayList%3CView%3E();%0A  %7D%0A  %0A  private TableRow getCurrentRow()%7B%0A    if (rowCounter %3E columnCount)%7B%0A      TableRow row = new TableRow(context);%0A      rowList.add(row);%0A      rowCounter = 0;%0A      return row;%0A    %7D else %7B%0A      TableRow row = rowList.get(rowList.size() - 1);%0A  
     
@@ -837,16 +837,22 @@
 ntext);%0A
+    %7D%0A
   %7D%0A  %0A 

Modify getCurrentRow