Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    listgrid.createrecordcomponent(ListGridRecord record, Integer colNum) not called for

    Hi,

    I have a issues like below.

    I defined a list grid with default height. and Override
    protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) method.

    This method should call for every row/data record addition to the list grid.

    During calling the data source to load records to the list grid. i get 10 records.

    Here only first 4/5 records this createRecordComponent() method called. rest of the records dosen't called.

    What i suspecting here is : Records loaded for specified height (in my case default height)createRecordComponent() method calling. For rest of the records some reason this method is not calling.

    Work around : if i defined the some height likr 450px for list grid for all the loaded records the createRecordComponent() method use to call......but this is not my expected out put.

    During pagination also its works as expected.
    But issues is during very first load to the listgrid.

    Attached is the image.

    Thanks,
    Hari.
    Attached Files

    #2
    It's calling the method for records that are in the Viewport - just scroll to have it called for the other records, or set recordComponentPoolingMode to "data" - that will call the method for all loaded rows

    Comment


      #3
      Hi, Tnx for your reply.....

      i added these lines to my list grid

      listGrid.setShowRecordComponents(true);
      listGrid.setShowRecordComponentsByCell(true);
      listGrid.setRecordComponentPoolingMode(RecordComponentPoolingMode.DATA);


      But still no change on the issue.

      Any suggestions.....

      Comment


        #4
        Please show a test-case we can run that shows the issue

        Comment


          #5
          Here is the ly list grid code

          getCellCSSText method is calling for all the records....i don't face any issue here.

          updateRecordComponent method added for listGrid.setRecordComponentPoolingMode(RecordComponentPoolingMode.DATA);



          private ListGrid getListingTable() {
          if (listGrid == null) {
          listGrid = new ListGrid() {
          @Override
          protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum) {
          String cellCSS = super.getCellCSSText(record, rowNum, colNum);
          cellCSS = (cellCSS == null) ? "" : cellCSS;
          // under line name
          return cellCSS;
          }

          @Override
          public Canvas updateRecordComponent(ListGridRecord record, Integer colNum, Canvas component,
          boolean recordChanged) {
          int rowNum = listGrid.getRecordIndex(record);
          String fieldName = this.getFieldName(colNum);
          if (fieldName != null && fieldName.equals(Constants.Action)) {
          final ComboBoxItem cbItem = new ComboBoxItem();
          LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
          valueMap.put("Select", "Select");
          valueMap.put("Details_" + rowNum, "Details");
          valueMap.put("Edit_" + rowNum, "Edit");

          cbItem.setValueMap(valueMap);
          cbItem.setShowTitle(false);
          cbItem.setDefaultToFirstOption(true);
          cbItem.setWidth(100);

          cbItem.addChangedHandler(new com.smartgwt.client.widgets.form.fields.events.ChangedHandler() {
          @Override
          public void onChanged(ChangedEvent event) {
          String value = event.getValue().toString().split("_")[0];
          int rowIndex = Integer.parseInt(event.getValue().toString().split("_")[1]);
          // my logic here
          }
          });

          DynamicForm f = new DynamicForm();
          f.setItems(cbItem);

          return f;
          } else {
          // TODO Auto-generated method stub
          return super.updateRecordComponent(record, colNum, component, recordChanged);
          }
          }

          @Override
          protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) {
          int rowNum = listGrid.getRecordIndex(record);
          String fieldName = this.getFieldName(colNum);
          if (fieldName != null && fieldName.equals(Constants.Action)) {
          final ComboBoxItem cbItem = new ComboBoxItem();
          LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
          valueMap.put("Select", "Select");
          valueMap.put("Details_" + rowNum, "Details");
          valueMap.put("Edit_" + rowNum, "Edit");

          cbItem.setValueMap(valueMap);
          cbItem.setShowTitle(false);
          cbItem.setDefaultToFirstOption(true);
          cbItem.setWidth(100);

          cbItem.addChangedHandler(new com.smartgwt.client.widgets.form.fields.events.ChangedHandler() {
          @Override
          public void onChanged(ChangedEvent event) {
          String value = event.getValue().toString().split("_")[0];
          int rowIndex = Integer.parseInt(event.getValue().toString().split("_")[1]);
          // my logic here
          }
          });

          DynamicForm f = new DynamicForm();
          f.setItems(cbItem);

          return f;
          } else {
          return null;
          }
          }
          };

          listgrid.setWidth100();
          //setHeight("330px");

          listgrid.setShowFilterEditor(Boolean.TRUE);
          listgrid.setAlternateRecordStyles(Boolean.FALSE);
          listgrid.setBaseStyle("boxedGridCell");
          listgrid.setCanEdit(false);
          listgrid.setAutoSaveEdits(Boolean.FALSE);
          listgrid.setShowRollOver(Boolean.FALSE);
          listgrid.setAutoFitFieldWidths(true);
          listgrid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
          listgrid.setCanGroupBy(false);
          listgrid.setCanMultiSort(false);
          listgrid.setCanAutoFitFields(false);
          listgrid.setAutoFitData(Autofit.VERTICAL);
          listgrid.setAutoFitMaxRecords(10);
          listgrid.setDataPageSize(25);
          listgrid.setModalEditing(false);
          listgrid.setSelectionType(SelectionStyle.MULTIPLE);
          listgrid.setFastCellUpdates(false);
          listgrid.setCanDragSelectText(true);
          listGrid.setShowRecordComponents(true);
          listGrid.setShowRecordComponentsByCell(true);
          listGrid.setRecordComponentPoolingMode(RecordComponentPoolingMode.DATA);
          listGrid.setInitialSort(initialSort);
          listGrid.setEmptyMessage(listGrid.getLoadingDataMessage());
          listGrid.setCanFreezeGridFields(false);
          listGrid.addDataArrivedHandler(getTotalRecordCountNumberLabel());

          loadDatasource();
          }
          return listGrid;
          }

          Comment


            #6
            Any suggestions.....

            Comment


              #7
              We're not seeing this problem on our end.
              You haven't mentioned what build version you're using - it may be a genuine bug that is already resolved - we'd recommend you try the latest nightly build for whichever branch you're working in and see if the issue persists.

              If it does, please
              - let us know what build you've tested against
              - show us a complete entryPoint class we can actually run to see the problem on our end. There may be some additional logic within your app causing the problem which wasn't revealed by the snippet you posted, so the best thing to do would be to make a new standalone class we can try out. Note that you can use a clientOnly dataSource to mimic your live data, or if that's too difficult, you could show us the result of any fetch requests by looking at the RPCTab so we can set up equivalent data on our end.

              Regards
              Isomorphic Software

              Comment


                #8
                Hi,

                i am using smartgwtee-3.0d.

                Now i downloaded latest version (on 19-Apr-2013) smartgwtee-4.0d 18-04-2013.

                My problem is fixed with latest nightly build.

                But i am facing few UI alignment issues with smartgwtee-4.0d 18-04-2013 build. Is this got resolves with latest one?
                or
                i have to take care myself in my application.

                Thanks for your good support.

                Thanks,
                Hari.

                Comment


                  #9
                  As with your previous issue, there is known issue of this kind. You have to provide details before we can help you with it.

                  Comment


                    #10
                    Hi,

                    Can you please tel me which details are required.

                    Details required for UI issue or nor calling the createRecordComponent() method for all the records?

                    Thanks,
                    Hari.

                    Comment


                      #11
                      Hi,

                      As i told in my previous message...here is the update for UI issue.

                      Images shows u the exact issue after loading the 4.0 libraries.

                      i attached my image and ready to run java classes also.

                      Thanks,
                      Hari.
                      Attached Files
                      Last edited by hari_k; 21 Apr 2013, 23:56. Reason: need add fews things

                      Comment


                        #12
                        Any suggestions.....

                        Comment


                          #13
                          The UI problem you're reporting is that there is no logic to enforce record components embedded within cells to fit within their column - autoFit won't take the size of the components into account and if the components exceed the specified width of the field they will overflow rather than being clipped by the column or similar.

                          This is currently a known limitation. We're looking into whether we can support this at the framework level, but for now we would recommend you handle this at the application level by specifying an explicit size for the field which is large enough to accomodate your record components.

                          Regards
                          Isomorphic Software.

                          Comment


                            #14
                            Just a note to say we've added some logic to the framework to ensure that when ListGrids are showing RecordComponents embedded in cells, fields will be auto-resized large enough to accomodate the components horizontally. This should resolve the UI issue where recordComponents can appear to overflow the width of the cell they're embedded in.

                            This change is part of 9.0 / 4.0 only and will be present in nightly builds dated June 7 and above.

                            Regards
                            Isomorphic Software

                            Comment

                            Working...
                            X