Announcement

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

    #16
    Hi Isomorphic,

    it turns out that this is not working as expected in all cases.
    • The in memory unique validation is also done for required="false" fields (see description-field in the testcase)
    • The normal unique validation against the DB is not done (search the server-log for "Desc B", which is one of the descriptions in the test csv-file. There is not SQL with it as search value)

    Testcase (using v10.1p_2016-04-21):

    supplyItem.ds.xml:
    Code:
    <DataSource xmlns="lmscompany/ds"
        ID="supplyItem"
        serverType="sql"
        tableName="supplyItem"
        titleField="itemName"
        testFileName="/examples/shared/ds/test_data/supplyItem.data.xml"
        dbImportFileName="/examples/shared/ds/test_data/supplyItemLarge.data.xml"
        >
        <fields>
            <field name="itemID"      type="sequence" hidden="true"       primaryKey="true"/>
            <field name="itemName"    type="text"     title="Item"        length="128"       required="true"/>
            <field name="SKU"         type="text"     title="SKU"         length="10"        required="true"/>
            <field name="description" type="text"     title="Description" length="2000">
                <validators>
                    <validator type="isUnique" />
                </validators>
            </field>
            <field name="category"    type="text"     title="Category"    length="128"       required="true"
                   foreignKey="supplyCategory.categoryName"/>
            <field name="units"       type="enum"     title="Units"       length="5">
                <valueMap>
                    <value>Roll</value>
                    <value>Ea</value>
                    <value>Pkt</value>
                    <value>Set</value>
                    <value>Tube</value>
                    <value>Pad</value>
                    <value>Ream</value>
                    <value>Tin</value>
                    <value>Bag</value>
                    <value>Ctn</value>
                    <value>Box</value>
                </valueMap>
            </field>
            <field name="unitCost"    type="float"    title="Unit Cost"   required="true">
                <validators>
                    <validator type="floatRange" min="0" errorMessage="Please enter a valid (positive) cost"/>
                    <validator type="floatPrecision" precision="2" errorMessage="The maximum allowed precision is 2"/>
                </validators>
            </field>
            <field name="inStock"   type="boolean"  title="In Stock"/>
            <field name="nextShipment"  type="date" title="Next Shipment"/>
        </fields>
    </DataSource>
    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.DataSource;
    import com.smartgwt.client.types.Alignment;
    import com.smartgwt.client.types.ListGridFieldType;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.BatchUploader;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.ImgButton;
    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.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.ListGridRecord;
    import com.smartgwt.client.widgets.grid.events.CellOutEvent;
    import com.smartgwt.client.widgets.grid.events.CellOutHandler;
    import com.smartgwt.client.widgets.grid.events.CellOverEvent;
    import com.smartgwt.client.widgets.grid.events.CellOverHandler;
    import com.smartgwt.client.widgets.grid.events.RowOutEvent;
    import com.smartgwt.client.widgets.grid.events.RowOutHandler;
    import com.smartgwt.client.widgets.grid.events.RowOverEvent;
    import com.smartgwt.client.widgets.grid.events.RowOverHandler;
    import com.smartgwt.client.widgets.layout.HLayout;
    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(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
            w.setTitle("TITLE" + w.getTitle());
            w.setShowMinimizeButton(false);
            w.setIsModal(true);
            w.setShowModalMask(true);
            w.centerInPage();
    
            final BatchUploader bu = new BatchUploader();
            bu.setUploadDataSource(DataSource.get("supplyItem"));
            w.addItem(bu);
            w.show();
        }
    }[B][/B]


    supplyItemTest.csv:
    Code:
    "nextShipment","category","itemName","itemID","unitCost","description","SKU","inStock","units"
    "2009-01-21","Audio","Small grey widget",,0.41,"Desc A","545315","","Ea"
    "2009-01-21","Audio","Large grey widget",,0.41,"Desc A","45300","","EACH"
    "2008-11-17","Pencils","Small blue gizmo",,-0.47,"Desc B","90600","","Ea"
    "","Waste Bins","Large green gizmo",,0.61,"Desc C","135900","","Packet"
    "","String","Small red widget",,0.58,"","190000","","Ea"
    "2014-11-17","String","Small piece of string",,0.22,"","90600","","Ea"
    "2012-03-11","String","More string",,0.58,"","1900111","","Roll"
    [B][/B]


    This is an important one for me.

    Best regards
    Blama

    Comment


      #17
      Here a screenshot of the two problems:
      Click image for larger version

Name:	BatchUploader Unique validation.png
Views:	78
Size:	16.4 KB
ID:	237333

      Comment


        #18
        Thanks for the notification. We're taking a look

        Regards
        Isomorphic Software

        Comment


          #19
          Hi Isomorphic,

          did you already into this one?

          Best regards
          Blama

          Comment


            #20
            Hi Isomorphic,

            did you already look into this one?

            Best regards
            Blama

            Comment


              #21
              Hi Blama
              Just a note to say - sorry for the silence here - we're looking into this behind the scenes but failed to update this thread to let you know.
              Anyway we'll follow up as soon as we have any more information for you.

              Regards
              Isomorphic Software

              Comment


                #22
                Hi Isomorphic,

                that's good to hear, I was wondering about the silence.
                Just to be sure: My account is still marked as having support, correct? It was prolonged just recently and very shortly before the previous support ended.

                Best regards
                Blama

                Comment


                  #23
                  Don't worry, you are still marked as having support. The latter question on this thread confused the developer who was originally looking into it and a few lengthy email conversations resulted. We'll have it wrapped up soon.

                  Comment


                    #24
                    Hi Isomorphic,

                    any update on this one?

                    Thank you & Best regards
                    Blama

                    Comment


                      #25
                      Apologies for the delay, this is fixed now and will be available in nightly builds since May 17 (today).

                      Comment


                        #26
                        Hi Isomprhic,

                        great, thank you. I'll test it with the next build.

                        Best regards
                        Blama

                        Comment


                          #27
                          Hi Isomorphic,

                          sorry for not replying earlier. This is working with v10.1p_2016-05-25 for me in my application and in the testcase.

                          Best regards
                          Blama

                          Comment

                          Working...
                          X