Announcement

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

    Severe bug with 5.1p and DynamicForm not issuing an update request

    Hi Isomorphic,

    I have a problem with a DynamicForm with a ValuesManager and saving changed data here.
    The same code did work with a end-November-build of 5.1p. It does no longer work with v10.1p_2017-03-02.

    I'm not sure exactly what the reason is and could not isolate the root cause, yet. Are there any changes in the code in this area, that could help me narrow it down?

    Calling valuesHaveChanged() in Developer Console prior to the save-attempt does return true.
    In the result, I do not have a request in the RPC-tab and no error, warning, whatsoever in the Results-tab.

    Do you have any idea what might happen here?

    Setting client log-levels up turned to this finding - perhaps related, perhaps not, I don't know:
    • See this sample (on the online showcase, on a newer version than my current 5.1p, it is on v11.0p_2017-03-06 as of now)
    • Set all logging to 'Warn' and category 'RPCManager' to 'Debug'
    • Change any Item, which results in this log entry
      Code:
      15:29:39.961:MUP3:INFO:RPCManager:sendQueue called with no current queue, ignoring
      This may or may not be correct? Why should sendQueue be called in this setting? This does also happen in my application.
    Best regards
    Blama

    #2
    Hi Isomorphic,

    the issue seems to be a fault of mine, not the framework. I forgot a required field, but the warning situation here is less than perfect. I'll provide a testcase soon.
    Regarding the client-side warning: I nevertheless wonder if this is correct.

    Best regards
    Blama

    Comment


      #3
      You never actually said what's going wrong. Is it that you call saveData(), but no request is issued? And if that is the cause, then are you saying it's because of a validation error due to a missing required field? If that is also what you meant, then why was it difficult to notice the validation error?

      Comment


        #4
        Hi Isomorphic,

        here is an testcase using v10.1p_2017-03-02 which displays the behavior.

        Observations:
        Loading, changing the name and saving does work for "Fetch good" and "Fetch bad"-items when calling without a ValuesManager.
        Loading, changing the name and saving does only work for "Fetch good" when calling with a ValuesManager.
        When saving the the "Fetch bad" when calling with a ValuesManager, there is no warning etc. in the Developer Console.

        I'd expect:
        1) Same behavior when using a ValuesManager and when not using it (actually I think the current behavior with a VM is the correct one).
        2) Some kind of warning in the Developer Console in both "Fetch bad"-cases: "Validation error for hidden or missing field description: Field is required'' like you already do in other cases when there is no GUI element to show the validation error.


        supplyItem.ds.xml addition:
        Code:
        [B]required="true"[/B] for description-field
        BuiltInDS.java:
        Code:
        package com.smartgwt.sample.client;
        
        import com.google.gwt.core.client.EntryPoint;
        import com.smartgwt.client.Version;
        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.types.OperatorId;
        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.DynamicForm;
        import com.smartgwt.client.widgets.form.ValuesManager;
        import com.smartgwt.client.widgets.form.fields.FormItem;
        import com.smartgwt.client.widgets.layout.VLayout;
        
        public class BuiltInDS implements EntryPoint {
            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();
                    }
                });
        
                VLayout mainLayout = new VLayout(20);
                mainLayout.setWidth100();
                mainLayout.setHeight100();
        
                IButton recreateBtn = new IButton("Recreate with VM");
                recreateBtn.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        recreate(true);
                    }
                });
                mainLayout.addMember(recreateBtn);
        
                IButton recreateBtn2 = new IButton("Recreate without VM");
                recreateBtn2.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        recreate(false);
                    }
                });
                mainLayout.addMember(recreateBtn2);
        
                recreate(true);
                mainLayout.draw();
            }
        
            private void recreate(final boolean withVM) {
                Window w = new Window();
                w.setWidth("95%");
                w.setHeight("95%");
                w.setMembersMargin(0);
                w.setModalMaskOpacity(70);
                w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
                w.setTitle("No warning for missing required field when using valuesManager" + w.getTitle());
                w.setShowMinimizeButton(false);
                w.setIsModal(true);
                w.setShowModalMask(true);
                w.centerInPage();
        
                final ValuesManager vm = new ValuesManager();
                vm.setDataSource(DataSource.get("supplyItem"));
        
                final DynamicForm supplyItemForm = new DynamicForm();
                supplyItemForm.setAutoFetchData(false);
                supplyItemForm.setDataSource(DataSource.get("supplyItem"));
        
                if (withVM)
                    supplyItemForm.setValuesManager(vm);
        
                FormItem itemID = new FormItem("itemID");
                FormItem itemName = new FormItem("itemName");
                FormItem SKU = new FormItem("SKU");
        
                supplyItemForm.setFields(itemID, itemName, SKU);
                w.addItem(supplyItemForm);
        
                IButton fetchGood = new IButton("Fetch good", new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        // Has description
                        if (withVM)
                            vm.fetchData(new AdvancedCriteria(new Criterion("SKU", OperatorId.EQUALS, "58074602")));
                        else
                            supplyItemForm.fetchData(new AdvancedCriteria(new Criterion("SKU", OperatorId.EQUALS, "58074602")));
                    }
                });
                w.addItem(fetchGood);
        
                IButton fetchBad = new IButton("Fetch bad", new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        // No description
                        if (withVM)
                            vm.fetchData(new AdvancedCriteria(new Criterion("SKU", OperatorId.EQUALS, "58074604")));
                        else
                            supplyItemForm.fetchData(new AdvancedCriteria(new Criterion("SKU", OperatorId.EQUALS, "58074604")));
                    }
                });
                w.addItem(fetchBad);
        
                IButton save = new IButton("Save data", new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        if (withVM)
                            vm.saveData();
                        else
                            supplyItemForm.saveData();
                    }
                });
                w.addItem(save);
                w.show();
            }
        }
        Best regards
        Blama

        Comment


          #5
          Probably crossposting...

          Originally posted by Isomorphic View Post
          If that is also what you meant, then why was it difficult to notice the validation error?
          Yes, that is what I meant and the problem is that there is no validation error.

          Best regards
          Blama

          Comment


            #6
            This has sat a few days without a followup. Just a quick notification to let you know we have a developer taking a look and will be following up as soon as we have anything for you.

            Regards
            Isomorphic Software

            Comment


              #7
              Hi Isomorphic,

              now that I know the cause this is currently not urgent for me.

              Best regards
              Blama

              Comment


                #8
                Hi Isomorphic,

                still minor to me, but just FYI, this is still unchanged with v11.1p_2017-08-16.

                Best regards
                Blama

                Comment

                Working...
                X