Announcement

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

    TimeItem required

    I have an issue with a required field of type: TimeItem if I don't edit the values (00:00). I get NULL values, although the fields are required and validation passes. This doesn't happen always, so click the button a few times and you will get the error described.
    Using 6.0-p20160813 power

    Code:
    public class TestingModule implements EntryPoint {
    
        public void onModuleLoad() {
            final DynamicForm df = new DynamicForm();
            df.setDataSource("testTable");
            TimeItem ti1 = new TimeItem("f_von");
            ti1.setRequired(true);
            ti1.setShowSecondItem(false);
            ti1.setUse24HourTime(true);
            ti1.setUseTextField(false);
            TimeItem ti2 = new TimeItem("f_bis");
            ti2.setRequired(true);
            ti2.setShowSecondItem(false);
            ti2.setUse24HourTime(true);
            ti2.setUseTextField(false);
            df.setFields(ti1, ti2);
            IButton click = new IButton("click me");
            click.addClickHandler(new ClickHandler() {
    
                @Override
                public void onClick(ClickEvent event) {
                    if (df.validate()) {
                        df.saveData(new DSCallback() {
    
                            @Override
                            public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
                                df.clearValues();
                                df.setSaveOperationType(DSOperationType.ADD);
                            }
                        });
                    }
                }
            });
    
            VLayout layout = new VLayout(10);
            layout.addMembers(df, click);
            layout.setWidth100();
            layout.setHeight100();
            layout.draw();
        }
    }
    Code:
    <DataSource ID="testTable" serverType="sql" tableName="testTable">
        <fields>
            <field name="f_id" type="sequence" primaryKey="true" />
            <field name="f_von" type="time" />
            <field name="f_bis" type="time" />
        </fields>
    </DataSource>
    Operation is ok:
    Code:
    {
        dataSource:"testTable",
        operationType:"add",
        componentId:"isc_DynamicForm_0",
        data:{
            f_von:"00:00:00.000",
            f_bis:"00:00:00.000"
        },
        textMatchStyle:"exact",
        callback:{
            target:[DynamicForm ID:isc_DynamicForm_0],
            methodName:"saveEditorReply"
        },
        showPrompt:true,
        prompt:"Speichere Formulardaten...",
        oldValues:{
        },
        requestId:"testTable$6270",
        internalClientContext:{
        },
        fallbackToEval:false,
        afterFlowCallback:"isc_DynamicForm_0.$49z(dsRequest, dsResponse, data)",
        editor:[DynamicForm ID:isc_DynamicForm_0],
        lastClientEventThreadCode:"MUP8",
        bypassCache:true,
        dataProtocol:"getParams"
    }
    Operation fails:
    Code:
    {
        dataSource:"testTable",
        operationType:"add",
        componentId:"isc_DynamicForm_0",
        data:{
            f_von:null,
            f_bis:null
        },
        textMatchStyle:"exact",
        callback:{
            target:[DynamicForm ID:isc_DynamicForm_0],
            methodName:"saveEditorReply"
        },
        showPrompt:true,
        prompt:"Speichere Formulardaten...",
        oldValues:{
        },
        requestId:"testTable$6271",
        internalClientContext:{
        },
        fallbackToEval:false,
        afterFlowCallback:"isc_DynamicForm_0.$49z(dsRequest, dsResponse, data)",
        editor:[DynamicForm ID:isc_DynamicForm_0],
        lastClientEventThreadCode:"MUP2",
        bypassCache:true,
        dataProtocol:"getParams"
    }
    Click image for larger version

Name:	Bildschirmfoto 2016-09-16 um 11.49.18.png
Views:	76
Size:	49.9 KB
ID:	240269

    #2
    We've made a change to address this issue. Please try the next nightly build, dated September 21.

    Regards
    Isomorphic Software

    Comment

    Working...
    X