Commit f33b2098 authored by sbade's avatar sbade

updated code to view filter if grid is to be shown in frame


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97677 ce508802-f39f-4f6c-b175-0d175dae99d5
parent dff21fab
package ibase.client;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -989,28 +993,31 @@ public class FilterCreator extends Composite
public void setTitleOnFilterSubmit(ArrayList<String> parameterList,JSONObject metaDataJsnObj)
{
if(GWTDashBoardReport.flag)
{
subTitle= Window.Location.getParameter("titleName");
}
title = new MetaDataDtl().getTitle(metaDataJsnObj);
if (title.size() > 1)
{
label.setText(title.get(0) + " : " + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2)));
}
else if (title.size() == 1 && (subTitle=="undefined") || (subTitle.equals("undefined")) || (subTitle.equalsIgnoreCase("undefined")))
{
label.setText(title.get(0) + " : " + getMonth(parameterList.get(1)));
}
//if(subTitle.trim().length()>0)
else if( (title.size() == 1 && (subTitle!="") || (!subTitle.equals("")) || (!subTitle.equalsIgnoreCase(""))))
{
label.setText( subTitle + " : " + getMonth(parameterList.get(1)) );
}
else
{
label.setText(title.get(0)+ " : " +getMonth( parameterList.get(1)));//+ "-" + parameterList.get(2));
}
if (title.size() > 1)
{
label.setText(title.get(0) + " : " + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2)));
}
else if (title.size() == 1 && (subTitle=="undefined") || (subTitle.equals("undefined")) || (subTitle.equalsIgnoreCase("undefined")))
{
label.setText(title.get(0) + " : " + getMonth(parameterList.get(1)));
}
//if(subTitle.trim().length()>0)
else if( (title.size() == 1 && (subTitle!="") || (!subTitle.equals("")) || (!subTitle.equalsIgnoreCase(""))))
{
label.setText( subTitle + " : " + getMonth(parameterList.get(1)) );
}
else
{
label.setText(title.get(0)+ " : " +getMonth( parameterList.get(1)));//+ "-" + parameterList.get(2));
}
}
}
\ No newline at end of file
......@@ -19,13 +19,14 @@ import com.google.gwt.xml.client.XMLParser;
public class GWTDashBoardReport implements EntryPoint
{
ArrayList<String> parameterList = new ArrayList<String>();
ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>();
ArrayList<String> parameterList = new ArrayList<String>();
public static ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>();
HorizontalPanel hpanel= new HorizontalPanel();
String metadataname = "";
// added by swati 30 dec 2014 for subtitle
public static String subTitle="";
public static boolean flag= false;
public static String prdFilterName= "";
// ended by swati 30 dec 2014 for subtitle
@SuppressWarnings("unchecked")
public void onModuleLoad()
......@@ -85,12 +86,15 @@ public class GWTDashBoardReport implements EntryPoint
month="0"+month;
}
monthYear=year+month;
int count =0;
if(filterList.size()>0)
{
for (FilterInfo filterInfo : filterList)
{
if(filterInfo.getColNameId().equals("PRD_SALESDASH"))
count++;
if(count==1)//if(filterInfo.getColNameId().equals("LAST_MONTH"))
{
prdFilterName=filterInfo.getColNameId();
parameterList.add(Window.Location.getParameter(filterInfo.getColNameId()) == null ? monthYear : Window.Location.getParameter(filterInfo.getColNameId()));
}
else
......
......@@ -63,10 +63,13 @@ public class GraphComponent extends Composite
/*End code for progess bar to data building- Dhanendra 17Nov2014*/
public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj)
{
String isShowfilter= Window.Location.getParameter("FLAG");
this.jsonObjMetaData = metaDataJsnObj;
this.parameterList = parameterList;
mainContainer.setWidth("100%");
if(! ("N").equalsIgnoreCase(isShowfilter)){
mainContainer.add(new FilterCreator(parameterList, metaDataJsnObj));
}
initWidget(mainContainer);
}
@SuppressWarnings("unchecked")
......@@ -160,7 +163,7 @@ public class GraphComponent extends Composite
// end- added empty json chartdata to display no data found message by swati on 7jan2015
if (graphJson != null && graphJson.size() > 0)
{
this.createChart(graphJson.toString().replace('$', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName);
this.createChart(graphJson.toString().replace('@', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName);
}
}
}
......@@ -195,7 +198,7 @@ public class GraphComponent extends Composite
} else if("DataGrid".equalsIgnoreCase(component))
{
flexTable = new FlexTable();
CustomGrid data = new CustomGrid(10);
CustomGrid data = new CustomGrid(8);
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId);
Button excelBtn = new Button("Export To Excel");
excelBtn.setTitle("Excel");
......@@ -247,7 +250,7 @@ public class GraphComponent extends Composite
// end- added empty json chartdata to display no data found message by swati on 7jan2015
if (graphJson != null && graphJson.size() > 0)
{
this.createChart(graphJson.toString().replace('$', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName);
this.createChart(graphJson.toString().replace('@', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName);
}
}
}
......@@ -310,7 +313,6 @@ public class GraphComponent extends Composite
if(i==0)
{
objActionPath=objActionPath + "?" + filterInfo.getName()+"="+parameterList.get(cnt);
}else
{
objActionPath=objActionPath + "&" + filterInfo.getName()+"="+parameterList.get(cnt);
......@@ -400,7 +402,6 @@ public class GraphComponent extends Composite
{
if (STATUS_CODE_OK == response.getStatusCode())
{
if (response.getText().trim().length() > 2) //if code is relese to OTC then Comment this if condition Dhanendra 07Nov2014
{
JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(response.getText());
......@@ -411,7 +412,6 @@ public class GraphComponent extends Composite
{
componentDataMap.put(key, null);
RootPanel.get("chartContainer"+key).clear();
}
if (componentDataMap.size() == datsSourceDtlMap.size())
{
......@@ -422,7 +422,6 @@ public class GraphComponent extends Composite
Window.alert("Responce for getData null");
}
}
@Override
public void onError(com.google.gwt.http.client.Request request, Throwable exception)
{
......@@ -434,7 +433,6 @@ public class GraphComponent extends Composite
e.printStackTrace();
e12LoadImg.setLoading(false);
}
}
}
public boolean isNumeric(String s) {
......
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