Announcement

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

    FormItem: "setReadOnlyWhen" - log error message

    Hi Isomorphic,

    I'm getting a log error message if I apply "setReadOnlyWhen" to FormItem.
    Code:
    [ERROR] [builtinds] - 17:29:42.596:XRP0:WARN:AutoTest:Locator string:item[0][Class="DynamicForm"] matching by index gave [DynamicForm ID:isc_DynamicForm_1]. Reliability cannot be guaranteed for matching by index if the underlying application undergoes any changes.
    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.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.fields.SelectItem;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class BuiltInDS extends VLayout implements EntryPoint {
        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();
                }
            });
    
            setWidth100();
            setHeight100();
    
            recreateBtn = new IButton("Recreate");
            recreateBtn.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    new MyWindow().show();
                }
            });
            addMember(recreateBtn);
            new MyWindow().show();
            draw();
        }
    
        private class MyWindow extends Window {
            public MyWindow() {
                setWidth(400);
                setHeight(300);
                setMembersMargin(0);
                setModalMaskOpacity(70);
                setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
                setTitle("img- vs object-tag issue" + getTitle());
                setShowMinimizeButton(false);
                setIsModal(true);
                setShowModalMask(true);
                centerInPage();
    
                final AdvancedCriteria readOnlyAC = new AdvancedCriteria(new Criterion("lifeSpan", OperatorId.EQUALS, 50));
    
                SelectItem si = new SelectItem("commonName");
                si.setReadOnlyWhen(readOnlyAC);
    
                DynamicForm df = new DynamicForm();
                df.setDataSource("animals");
                df.setFields(si);
                df.fetchData();
    
                addItem(df);
            }
        }
    }
    Am I doing something wrong?

    Best regards
    Pavo

    #2
    This looks like an already-fixed bug. If you aren't already using the latest, please check with the latest, and remember to always post your version information.

    Comment

    Working...
    X