Skip to content

Commit

Permalink
Data Table Deletion Completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Khanna committed Aug 12, 2014
1 parent a3a2df2 commit 37c4873
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
= DataTableDataFragment.newInstance(clientDataTables.get(id), clientId);
FragmentTransaction fragmentTransaction = getActivity().getSupportFragmentManager().beginTransaction();
fragmentTransaction.addToBackStack(FragmentConstants.FRAG_CLIENT_DETAILS);
fragmentTransaction.replace(R.id.global_container, dataTableDataFragment);
fragmentTransaction.replace(R.id.global_container, dataTableDataFragment, FragmentConstants.FRAG_DATA_TABLE);

fragmentTransaction.commit();
} else if (id == MENU_ITEM_DOCUMENTS) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ public void inflateView() {
public void success(JsonArray jsonElements, Response response) {

if (jsonElements != null) {
linearLayout = DataTableUIBuilder.getDataTableLayout(dataTable, jsonElements, linearLayout, getActivity(), entityId, (DataTableUIBuilder.DataTableActionListener)getParentFragment());
linearLayout.invalidate();
DataTableUIBuilder.DataTableActionListener mListener = (DataTableUIBuilder.DataTableActionListener) getActivity().getSupportFragmentManager().findFragmentByTag(FragmentConstants.FRAG_DATA_TABLE);
linearLayout = new DataTableUIBuilder().getDataTableLayout(dataTable, jsonElements, linearLayout, getActivity(), entityId, mListener);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,22 @@
*/
public class DataTableUIBuilder {

static int tableIndex;
static DataTableActionListener dataTableActionListener;
int tableIndex;
private DataTableActionListener dataTableActionListener;

public static LinearLayout getDataTableLayout(final DataTable dataTable,
public LinearLayout getDataTableLayout(final DataTable dataTable,
JsonArray jsonElements,
LinearLayout parentLayout,
final Context context,
final int entityId,
DataTableActionListener mListener){

dataTableActionListener = mListener;
Log.i("Number of Column Headers", "" + dataTable.getColumnHeaderData().size());
/**
* Create a Iterator with Json Elements to Iterate over the DataTable
* Response.
*/
Iterator<JsonElement> jsonElementIterator = jsonElements.iterator();
dataTableActionListener = mListener;
/*
* Each Row of the Data Table is Treated as a Table Here.
* Creating the First Table for First Row
Expand Down Expand Up @@ -139,7 +138,7 @@ public void failure(RetrofitError retrofitError) {
}
);

return false;
return true;
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ public class FragmentConstants {

public static final String FRAG_CLIENT_SEARCH = "Client Search Fragment";
public static final String DFRAG_DATATABLE_ENTRY_FORM = "Data_Table_Entry_Form";

public static final String FRAG_DATA_TABLE = "Data Table Fragment";
}

0 comments on commit 37c4873

Please sign in to comment.