SmartClient Version: v12.1p_2021-10-22/PowerEdition Deployment (built 2021-10-22)
I have a very basic cube grid that displays in a popup window.
I'm attempting to get it to load with a datasource, but it fails to draw. The fetchData callback returns with the correct and appropriate data, which is then written to the grid with a setData() call, and after a delay (artificial I don't really want this) I call window.show() to draw the popup.
If I code using Static data (same as the fetchData return ) and in one case apply the setData() outside the callback I see the drawn Cube Grid, and in the other case I apply the setData() in the fetchData callback, I don't see the drawn Cube Grid. What am I missing.
Here is case 1, a successful draw of the Cube in the popup window. The setData() is done OUTSIDE of the callback.
Here is the result:
And in the second case I do the setData from within the callback, and delay the detailWin.show(), but no grid is created.
The result of this code is:
I have tried to qualify the detailsWin.show by a if ( dvdCube.isCreated() ) condition, and the result is the same blank popup.
What am I missing here?
I have a very basic cube grid that displays in a popup window.
I'm attempting to get it to load with a datasource, but it fails to draw. The fetchData callback returns with the correct and appropriate data, which is then written to the grid with a setData() call, and after a delay (artificial I don't really want this) I call window.show() to draw the popup.
If I code using Static data (same as the fetchData return ) and in one case apply the setData() outside the callback I see the drawn Cube Grid, and in the other case I apply the setData() in the fetchData callback, I don't see the drawn Cube Grid. What am I missing.
Here is case 1, a successful draw of the Cube in the popup window. The setData() is done OUTSIDE of the callback.
Code:
final CubeGrid dvdCube = new CubeGrid(); dvdCube.setRowFacets("Status","VBin"); dvdCube.setColumnFacets("TopTitle","DVDMode", "Category", "CVT"); dvdCube.setValueProperty("Count"); dvdCube.setHideEmptyFacetValues(true); final List<ListGridRecord> dvdD = new ArrayList<ListGridRecord>(); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.00::0.01", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.01::0.02", "Completed", 7)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.05::0.06", "Completed with Errors", 800)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.00::0.01", "Completed", 4)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.05::0.06", "Completed", 1000)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.00::0.01", "Completed", 8)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.03::0.04", "Completed", 20)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.05::0.06", "Completed", 900)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.00::0.01", "Completed", 9)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.05::0.06", "Completed", 1220)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.00::0.01", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.01::0.02", "Completed", 4)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.03::0.04", "Completed", 330)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.05::0.06", "Completed", 900)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.06::0.07", "Completed with Errors", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.00::0.01", "Completed", 3)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.05::0.06", "Completed", 1230)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.00::0.01", "Completed", 40)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.03::0.04", "Completed with Errors", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.05::0.06", "Completed", 700)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.06::0.07", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.00::0.01", "Completed", 20)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.05::0.06", "Completed", 1000)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.06::0.07", "Completed", 0)); dvdCube.setWidth(1100); dvdCube.setHeight(360); dvdCube.setOverflow(Overflow.VISIBLE); dvdCube.setDataSource(DataSource.get("BCG_BE_STA_DVD_Checks")) dvdCube.setFetchOperation("fetchDVDBlockDetails"); dvdCube.setAutoFetchData(false); DSRequest dvdReq = new DSRequest(); dvdReq.setOperationId("fetchDVDBlockDetails"); final AdvancedCriteria critDVD= new AdvancedCriteria(OperatorId.AND, new Criterion[] { new Criterion("Block_Name", OperatorId.EQUALS, clickedRec.getAttribute("Block_Name")), new Criterion("FK_Layout_Rundir", OperatorId.EQUALS, clickedRec.getAttribute("FK_Layout_Rundir")) }); DataSource.get("BCG_BE_STA_DVD_Checks").fetchData(critDVD, new DSCallback() { @Override public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) { if(dsResponse.getData().length < 1) { return; } // dvdCube.setData( dvdD.toArray( new ListGridRecord[ dvdD.size()] )); // set data inside callback // Timer delayCubeShow = new Timer() { // public void run() { // detailsWin.show(); // just delay the show, even setting it to 20 seconds doesn't cause the grid to draw. // } // }; // delayCubeShow.schedule(1000); } }, dvdReq); dvdCube.setData( dvdD.toArray( new ListGridRecord[ dvdD.size()] )); // Set data outside callback. VLayout dvdLayout = new VLayout(); dvdLayout.setWidth100(); dvdLayout.setHeight100(); dvdLayout.setPadding(5); dvdLayout.setMargin(10); dvdLayout.setMembersMargin(5); dvdLayout.setOverflow(Overflow.AUTO); dvdLayout.setMembers(dvdCube); detailsWin.setMaxHeight(800); detailsWin.setMaxWidth(1300); detailsWin.setWidth("50%"); detailsWin.setHeight("33%"); detailsWin.addItem(dvdLayout); Timer delayCubeShow = new Timer() { public void run() { detailsWin.show(); } }; delayCubeShow.schedule(1000); }
Here is the result:
And in the second case I do the setData from within the callback, and delay the detailWin.show(), but no grid is created.
Code:
final CubeGrid dvdCube = new CubeGrid(); dvdCube.setRowFacets("Status","VBin"); dvdCube.setColumnFacets("TopTitle","DVDMode", "Category", "CVT"); dvdCube.setValueProperty("Count"); dvdCube.setHideEmptyFacetValues(true); final List<ListGridRecord> dvdD = new ArrayList<ListGridRecord>(); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.00::0.01", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.01::0.02", "Completed", 7)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.05::0.06", "Completed with Errors", 800)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ff069125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.00::0.01", "Completed", 4)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.05::0.06", "Completed", 1000)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ff069125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.00::0.01", "Completed", 8)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.03::0.04", "Completed", 20)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.05::0.06", "Completed", 900)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Standard", "ss077125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.00::0.01", "Completed", 9)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.05::0.06", "Completed", 1220)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Max", "Special", "ss077125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.00::0.01", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.01::0.02", "Completed", 4)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.03::0.04", "Completed", 330)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.05::0.06", "Completed", 900)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ff069125", "0.06::0.07", "Completed with Errors", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.00::0.01", "Completed", 3)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.05::0.06", "Completed", 1230)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ff069125", "0.06::0.07", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.00::0.01", "Completed", 40)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.03::0.04", "Completed with Errors", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.05::0.06", "Completed", 700)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Standard", "ss077125", "0.06::0.07", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.00::0.01", "Completed", 20)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.01::0.02", "Completed", 0)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.02::0.03", "Completed", 10)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.03::0.04", "Completed", 30)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.05::0.06", "Completed", 1000)); dvdD.add(CubeGridConfig.setCubeGridDVDData("VBin Count", "Pwr_Opt", "Special", "ss077125", "0.06::0.07", "Completed", 0)); dvdCube.setWidth(1100); dvdCube.setHeight(360); dvdCube.setOverflow(Overflow.VISIBLE); dvdCube.setDataSource(DataSource.get("BCG_BE_STA_DVD_Checks")) dvdCube.setFetchOperation("fetchDVDBlockDetails"); dvdCube.setAutoFetchData(false); DSRequest dvdReq = new DSRequest(); dvdReq.setOperationId("fetchDVDBlockDetails"); final AdvancedCriteria critDVD= new AdvancedCriteria(OperatorId.AND, new Criterion[] { new Criterion("Block_Name", OperatorId.EQUALS, clickedRec.getAttribute("Block_Name")), new Criterion("FK_Layout_Rundir", OperatorId.EQUALS, clickedRec.getAttribute("FK_Layout_Rundir")) }); DataSource.get("BCG_BE_STA_DVD_Checks").fetchData(critDVD, new DSCallback() { @Override public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) { if(dsResponse.getData().length < 1) { return; } dvdCube.setData( dvdD.toArray( new ListGridRecord[ dvdD.size()] )); // set data inside callback Timer delayCubeShow = new Timer() { public void run() { detailsWin.show(); // just delay the show, even setting it to 20 seconds doesn't cause the grid to draw. } }; delayCubeShow.schedule(1000); // shouldn't the cube grid draw? } }, dvdReq); // dvdCube.setData( dvdD.toArray( new ListGridRecord[ dvdD.size()] )); // Set data outside callback. VLayout dvdLayout = new VLayout(); dvdLayout.setWidth100(); dvdLayout.setHeight100(); dvdLayout.setPadding(5); dvdLayout.setMargin(10); dvdLayout.setMembersMargin(5); dvdLayout.setOverflow(Overflow.AUTO); dvdLayout.setMembers(dvdCube); detailsWin.setMaxHeight(800); detailsWin.setMaxWidth(1300); detailsWin.setWidth("50%"); detailsWin.setHeight("33%"); detailsWin.addItem(dvdLayout); // Timer delayCubeShow = new Timer() { // public void run() { // detailsWin.show(); // } // }; // delayCubeShow.schedule(1000); }
I have tried to qualify the detailsWin.show by a if ( dvdCube.isCreated() ) condition, and the result is the same blank popup.
What am I missing here?
Comment