Commit 02c240fc authored by sbade's avatar sbade

updated code for mandatory filter field and dynamic url for servlet.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96941 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bc408c3a
......@@ -126,10 +126,8 @@ public class ChartCreator
{
currentvalue = (fetchRowWiseVal.get(yAxisColunList.get(yCnt)).toString().replace('"', ' ').trim());
valueList.add(currentvalue);
}
allDataMap.put(key, valueList);
}
allDataMap.put(key, valueList);
key = "";
}
valueMapSet = allDataMap.keySet();
......
......@@ -96,29 +96,30 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
int count=0;
for(int jRowCtr=0;jRowCtr<jsonObjData.size();jRowCtr++)
{
rowData = new HashMap<Integer, E12CustomTextCell.CellData> ();
for (String graphKey : graphDataMap.keySet())
rowData = new HashMap<Integer, E12CustomTextCell.CellData> ();
for (String graphKey : graphDataMap.keySet())
{
graphDtlList = graphDataMap.get(graphKey);
jsonEachRow = new JSONObject();
jsonEachRow = (JSONObject)jsonObjData.get(""+jRowCtr);
count=rowData.size();
for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++)
{
graphDtlList = graphDataMap.get(graphKey);
jsonEachRow = new JSONObject();
jsonEachRow = (JSONObject)jsonObjData.get(""+jRowCtr);
// Window.alert("jsonEachRow:"+jsonEachRow);
count=rowData.size();
for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++)
{
celldata = new E12CustomTextCell.CellData((""+jsonEachRow.get(""+graphDtlList.get(jDataCtr))).replace('"', ' '));
celldata.setMandatory(true);
celldata.setOriginalText("Cell"+jDataCtr);
celldata.setName(""+(graphDtlList.get(jDataCtr)).replace('"', ' '));
rowData.put(count, celldata);
count++;
}
}
rowDataGrid = new DataGridTableRowModel(rowData);
dataGridTableRowList.add(rowDataGrid);
if(jsonEachRow.get(graphDtlList.get(jDataCtr))!=null)
{
celldata = new E12CustomTextCell.CellData((""+jsonEachRow.get(""+graphDtlList.get(jDataCtr))).replace('"', ' '));
celldata.setMandatory(true);
celldata.setOriginalText("Cell"+jDataCtr);
celldata.setName(""+(graphDtlList.get(jDataCtr)).replace('"', ' '));
rowData.put(count, celldata);
count++;
}
}
}
rowDataGrid = new DataGridTableRowModel(rowData);
dataGridTableRowList.add(rowDataGrid);
}
ColumnInfoBean columnInfoBean=null;
graphDataMap =gridNGraphMeataDataMap.get("columnName"+componentId);
......@@ -157,7 +158,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
{
final int noOfRows = dataGridTableRowList.size();
final int noOfColumns = dataGridTableColList.size();
dataProvider.setList( dataGridTableRowList );
//Add by Dnyaneshwar chavan on 07-DEC-2012 [WS2GSUN002 || ] Start
E12CustomColumn firstColumn = null;
......@@ -176,8 +176,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
final ListHandler<DataGridTableRowModel> sortHandler = new ListHandler<DataGridTableRowModel>( dataProvider.getList())
{
@Override
public void onColumnSort(ColumnSortEvent event)
{
public void onColumnSort(ColumnSortEvent event) {
super.onColumnSort(event);
dataProvider.refresh();
}
......@@ -252,7 +251,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
final SimplePager displayPager = new SimplePager(SimplePager.TextLocation.CENTER, displayPagerResources, false, 0 , true, excelBtnPnl);
displayPager.setDisplay(this);
displayPager.setRangeText(rangeText);
Label labelNoDataFound = new Label("No Data Found");
Command setRowCmd = new Command() {
@Override
public void execute()
......@@ -284,16 +282,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
if(caption.trim().length()!=0)
{
flexTable.setText(0, 0, caption);
if(noOfRows<=0)
{
flexTable.setWidget(1, 0, labelNoDataFound);
}else
{
flexTable.setWidget(1, 0, this);
}
//flexTable.setWidget(1, 0, this);
flexTable.setWidget(1, 0, this);
flexTable.setWidget(2, 0, displayPager);
flexTable.getCellFormatter().setStyleName(0 ,0 , "FlexTable-ColumnHeaderCell");
flexTable.getCellFormatter().setStyleName(1 ,0 , "gwt-ScrollTable");
......@@ -309,15 +298,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
}else
{
if(noOfRows<=0)
{
flexTable.setWidget(0, 0, labelNoDataFound);
}else
{
flexTable.setWidget(0, 0, this);
}
//flexTable.setWidget(0, 0, this);
flexTable.setWidget(0, 0, this);
flexTable.setWidget(1, 0, displayPager);
flexTable.getCellFormatter().setStyleName(0 ,0 , "gwt-ScrollTable");
......@@ -331,18 +312,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
}
}
/*flexTable.setHeight( Window.getClientHeight() - 195 + "px" );
setHeight( Window.getClientHeight() - 240+ "px" );
setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/
flexTable.setHeight("330px");
setHeight("330px");
flexTable.setHeight( Window.getClientHeight() - 240 + "px" );
flexTable.setHeight("320px");
setHeight("320px");
/*setHeight( Window.getClientHeight() - 207+ "px" );*/
/*setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/
/*flexTable.setHeight( Window.getClientHeight() - 225 + "px" );
setHeight( Window.getClientHeight() - 207+ "px" );
setHeight( ( ( Window.getClientHeight() - 215 ))+ "px" );*/
//flexTable.setHeight("320px");
//setHeight( ( ( Window.getClientHeight() - 350 ))+ "px" );
//addStyleName("e12AdvDataGrid-SideBars");
addStyleName("e12AdvDataGrid-SideBars");
return flexTable;
}
......
......@@ -245,8 +245,13 @@ public class FilterCreator extends Composite
mainPopupPnl.setPopupPosition(100, 60);
mainPopupPnl.getElement().setId("filterMainOuterDiv");
mainPopupPnl.add(homePgFltrPopupVPnl);
mainPopupPnl.show();
//mainPopupPnl.show();
/* stat--added new code to hide empty filter onload dated : 03-Dec-2014*/
if(popUpHPnl.getWidgetCount()!=0)
{
mainPopupPnl.show();
}
/* End-- added new code to hide empty filter onload*/
cancelimage.addClickHandler(new ClickHandler()
{
@Override
......@@ -593,7 +598,7 @@ public class FilterCreator extends Composite
parameterValue = paramtrArray[paramtrCnt];
if (parameterValue.trim().equalsIgnoreCase(colData.trim()))
{
RadioButton radioBtnOnLod = (RadioButton) flexTable.getWidget(Integer.parseInt(row) + 1, 0);
RadioButton radioBtnOnLod = (RadioButton)flexTable.getWidget(Integer.parseInt(row) + 1, 0);
radioBtnOnLod.setValue(true);
}
}
......@@ -821,6 +826,7 @@ public class FilterCreator extends Composite
private void getFltrSelectedData(ArrayList<FilterInfo> filterList, PopupPanel mainPopupPnl)
{
boolean isFilterNotSelected = false;
int row = 0;
FlexTable grid = null;
......@@ -838,12 +844,13 @@ public class FilterCreator extends Composite
HorizontalPanel horizontalPanel = null;
VerticalPanel verticalPanel = null;
String colNameId = "";
String mandatotyFilter = "";
for (int i = 0; i < filterList.size(); i++)
{
fltrInfo = filterList.get(i);
colName = fltrInfo.getColName();
colNameId = fltrInfo.getColNameId();
mandatotyFilter = fltrInfo.getMandatory();
for (int scrlPnlCnt = 0; scrlPnlCnt < popUpHPnl.getWidgetCount(); scrlPnlCnt++)
{
......@@ -875,21 +882,21 @@ public class FilterCreator extends Composite
}
if (scrollPnl.getTitle().equals(colName))
{
//if (selectedChkBoxBuffer.toString().trim().length() != 0)
if (selectedChkBoxBuffer.toString()!= null)
if (selectedChkBoxBuffer.toString().trim().length() != 0)
//if (selectedChkBoxBuffer.toString()!= null)
{
popUpSendDtatList.add(selectedChkBoxBuffer.toString());
} else
{
if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
//if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId))
if("Y".equalsIgnoreCase(mandatotyFilter))
{
Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.setTitle(windowTitle);
isFilterNotSelected = true;
}
}
}
}
} else if (horizontalPanel.getWidget(0) instanceof TextBox)
......@@ -897,14 +904,14 @@ public class FilterCreator extends Composite
fltrTxtBox = (TextBox) horizontalPanel.getWidget(0);
if (fltrTxtBox.getTitle().equals(colName))
{
//if (!fltrTxtBox.getText().isEmpty())
if (fltrTxtBox.getText()!=null)
if (!fltrTxtBox.getText().isEmpty())
//if (fltrTxtBox.getText()!=null)
{
popUpSendDtatList.add(fltrTxtBox.getText());
} else
{
if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
//if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
if("Y".equalsIgnoreCase(mandatotyFilter))
{
Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.setTitle(windowTitle);
......@@ -938,19 +945,14 @@ public class FilterCreator extends Composite
}
}
}
//if (selectedChkBoxBuffer.toString().trim().length() != 0)
if (selectedChkBoxBuffer.toString()!= null)
if (selectedChkBoxBuffer.toString().trim().length() != 0)
//if (selectedChkBoxBuffer.toString()!= null)
{
popUpSendDtatList.add(selectedChkBoxBuffer.toString());
} else
{
/*if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) || !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
{
Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.setTitle(windowTitle);
isFilterNotSelected = true;
}*/
if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
//if(!"CUST_CODE_SUNUSA".equalsIgnoreCase(colNameId) && !"CUST_CODE_DLV".equalsIgnoreCase(colNameId))
if("Y".equalsIgnoreCase(mandatotyFilter))
{
Window.alert(fltrInfo.getColName() + "Can't Be Empty");
Window.setTitle(windowTitle);
......@@ -961,10 +963,8 @@ public class FilterCreator extends Composite
}
}
}
}
}
}
if (!isFilterNotSelected)
{
......
......@@ -22,7 +22,10 @@ public class FilterInfo
String colNameId = "";
String colModuleName = "";
String filterType = "";
String mandatory = "";
String name = "";
public String getColTitle()
{
return colTitle;
......@@ -92,5 +95,24 @@ public class FilterInfo
{
this.colModuleName = colModuleName;
}
public String getMandatory()
{
return mandatory;
}
public void setMandatory(String mandatory)
{
this.mandatory = mandatory;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
}
......@@ -538,6 +538,11 @@ public class MetaDataDtl
filterInfo.setColName(columNode.getChildNodes().item(0).getNodeValue());
filterInfo.setColNameId(columNode.getAttributes().getNamedItem("id").getNodeValue());
filterInfo.setColModuleName(columNode.getAttributes().getNamedItem("moduleName").getNodeValue());
/*Add Dhanendra For 2 Attribute in Metaxml 8Dec2014*/
filterInfo.setName(columNode.getAttributes().getNamedItem("name").getNodeValue());
filterInfo.setMandatory(columNode.getAttributes().getNamedItem("mandatory").getNodeValue());
/*End Dhanendra For 2 Attribute in Metaxml 8Dec2014*/
}
if ("col_descr".equals(columNode.getNodeName()))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment