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