Announcement

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

    #16
    Hi Isomorphic,

    only post #14 is Dev Mode specific, the original issue showed up everywhere.
    After your change from #13 it is only happening in Dev Mode (broken design from the original issue plus the new exception in Dev Mode that was not there before).

    Does that answer your questions?
    I did not see anything fail in DevMode and working in Compiled Mode, so far.

    Best regards
    Blama

    Comment


      #17
      We're not really following - your last line says you see no failures in DevMode, and it's working in compiled mode...

      Can you please restate from scratch the situation as it stands now - what problems you still have, what modes and browsers you see them in, and the current code that reproduces them.

      Comment


        #18
        Hi Isomorphic,

        my last sentence "I did not see anything fail in DevMode and working in Compiled Mode, so far." I meant that I never had the case before that code worked in compiled mode and threw exceptions in Development Mode.

        I do have the problem in my application using FF26 Dev Mode and in the Testcase using FF26 Dev Mode.
        I do not have the problem in my application in Complied Mode.
        I did not test the Testcase in Complied Mode.


        I tested using v10.1p_2016-03-22,Simplicity skin and this testcase (c&p from #7):

        Please change this in animals.ds.xml (see the length="500"):

        Code:
        <field name="status" title="Endangered Status" type="text" length="500" />
        BuiltInDS.java:
        Code:
        package com.smartgwt.sample.client;
        
        import java.util.LinkedHashMap;
        
        import com.google.gwt.core.client.EntryPoint;
        import com.smartgwt.client.core.KeyIdentifier;
        import com.smartgwt.client.data.AdvancedCriteria;
        import com.smartgwt.client.data.Criterion;
        import com.smartgwt.client.data.DataSource;
        import com.smartgwt.client.data.SortSpecifier;
        import com.smartgwt.client.types.OperatorId;
        import com.smartgwt.client.types.SortDirection;
        import com.smartgwt.client.util.Page;
        import com.smartgwt.client.util.PageKeyHandler;
        import com.smartgwt.client.util.SC;
        import com.smartgwt.client.widgets.IButton;
        import com.smartgwt.client.widgets.Window;
        import com.smartgwt.client.widgets.events.ClickEvent;
        import com.smartgwt.client.widgets.events.ClickHandler;
        import com.smartgwt.client.widgets.form.fields.FormItem;
        import com.smartgwt.client.widgets.form.fields.SelectItem;
        import com.smartgwt.client.widgets.form.fields.StaticTextItem;
        import com.smartgwt.client.widgets.form.fields.TextItem;
        import com.smartgwt.client.widgets.grid.ListGrid;
        import com.smartgwt.client.widgets.grid.ListGridEditorContext;
        import com.smartgwt.client.widgets.grid.ListGridEditorCustomizer;
        import com.smartgwt.client.widgets.grid.ListGridField;
        import com.smartgwt.client.widgets.layout.VLayout;
        
        public class BuiltInDS implements EntryPoint {
            private VLayout mainLayout;
            private IButton recreateBtn;
        
            public void onModuleLoad() {
                KeyIdentifier debugKey = new KeyIdentifier();
                debugKey.setCtrlKey(true);
                debugKey.setKeyName("D");
        
                Page.registerKey(debugKey, new PageKeyHandler() {
                    public void execute(String keyName) {
                        SC.showConsole();
                    }
                });
        
                mainLayout = new VLayout(20);
                mainLayout.setWidth100();
                mainLayout.setHeight100();
        
                recreateBtn = new IButton("Recreate");
                recreateBtn.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        recreate();
                    }
                });
                mainLayout.addMember(recreateBtn);
                recreate();
                mainLayout.draw();
            }
        
            private void recreate() {
                Window w = new Window();
                w.setWidth("95%");
                w.setHeight("95%");
                w.setMembersMargin(0);
                w.setModalMaskOpacity(70);
                w.setTitle("ListGrid-editRow FormItems get ListGrid CSS classes when normal editor is TextAreaItem");
                w.setShowMinimizeButton(false);
                w.setIsModal(true);
                w.setShowModalMask(true);
                w.centerInPage();
        
                final ListGrid animalsGrid = new ListGrid();
        
                animalsGrid.setHeight100();
                animalsGrid.setAutoFetchData(false);
                animalsGrid.setCanEdit(true);
                animalsGrid.setDataSource(DataSource.get("animals"));
                animalsGrid.setCanGroupBy(false);
                animalsGrid.setShowRecordComponents(false);
                animalsGrid.setShowRecordComponentsByCell(false);
        
                ListGridField commonName = new ListGridField("commonName");
                commonName.setCanEdit(false);
                ListGridField scientificName = new ListGridField("scientificName");
                scientificName.setCanEdit(false);
                ListGridField lifeSpan = new ListGridField("lifeSpan");
                ListGridField status = new ListGridField("status");
                ListGridField diet = new ListGridField("diet");
                diet.setCanEdit(false);
        
                animalsGrid.setEditorCustomizer(new ListGridEditorCustomizer() {
                    public FormItem getEditor(ListGridEditorContext context) {
                        ListGridField field = context.getEditField();
                        String animal = context.getEditedRecord().getAttributeAsString("commonName");
                        switch (animal) {
        
                        case "Anteater":
                            switch (field.getName()) {
                            case "lifeSpan":
                                return new StaticTextItem();
                            case "status":
                                return new SelectItem() {
                                    {
                                        setValueMap(new LinkedHashMap<String, String>() {
                                            private static final long serialVersionUID = 1L;
                                            {
                                                put("Y", "Yes");
                                                put("N", "No");
                                            }
                                        });
                                    }
                                };
                            default:
                                return context.getDefaultProperties();
                            }
                        case "Arabian Camel":
                            switch (field.getName()) {
                            case "lifeSpan":
                                return new StaticTextItem();
                            case "status":
                                return new TextItem();
                            default:
                                return context.getDefaultProperties();
                            }
                        default:
                            return context.getDefaultProperties();
                        }
                    }
                });
                animalsGrid.setFields(commonName, scientificName, lifeSpan, status, diet);
                animalsGrid.setSort(new SortSpecifier[] { new SortSpecifier(commonName.getName(), SortDirection.ASCENDING) });
                animalsGrid.fetchData(new AdvancedCriteria(new Criterion("commonName", OperatorId.STARTS_WITH, "A")));
                w.addItem(animalsGrid);
                w.show();
            }
        }[B][/B]


        Double click a row in Development Mode to see the exception thrown multiple times and the original display issue as in versions before your change.
        Double click a row in Complied Mode to see that your change fixes the original issue in Compiled Mode.

        Best regards
        Blama
        Last edited by Blama; 23 Mar 2016, 08:46. Reason: Copy & Paste did not work

        Comment


          #19
          This should be fixed now, for builds dated April 5 and later.

          Comment


            #20
            Hi Isomorphic,

            I can confirm that it is fixed using the testcase and v10.1p_2016-04-05.

            Thank you & Best regards
            Blama

            Comment


              #21
              Hi Isomorphic,

              we also get this exception (java.lang.NullPointerException: null
              at com.smartgwt.client.widgets.grid.ListGridEditorContext.<init>(ListGridEditorContext.java:23)). We use version 10.0-p20160615.
              Can you, please, port this fix also to 10.0? Upgrading to 10.1 would be really hard for us, so having this fix in 10.0 would really help us.
              Thanks in advance!

              Best regards,
              Iaroslav Mazai

              Comment


                #22
                This has been fixed in SmartGWT 5.0 / SmartClient 10.0 for builds dated June 25 and later

                Comment

                Working...
                X