Hi,
I''ve found problems with setReadOnlyWhen() on an FormItem.
First problem is that condition is not always applied when form is showed and second my console is filled with errors like:
Test case:
I've made it work at startup by adding DataSource and editNewRecord() / editRecord() to form.
But I cannot resolve issue with warnings. They appear in large amount when I change radio value.
Strange is that when I put this form on page (not in window) it works fine. It doesn't help to wrap form in other layouts and then into window.
So problem is probably connected with Window.
Tested on SmartGWT 12.0p 2019-04-11
Best regards
Mariusz Goch
I''ve found problems with setReadOnlyWhen() on an FormItem.
First problem is that condition is not always applied when form is showed and second my console is filled with errors like:
Code:
*23:45:48.550: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:
DataSource ds = new DataSource(); ds.addField(new DataSourceTextField("type")); ds.addField(new DataSourceFloatField("discount")); DynamicForm form = new DynamicForm(); form.setDataSource(ds); AdvancedCriteria criteriaCollect = new AdvancedCriteria(); criteriaCollect.addCriteria("type", OperatorId.EQUALS, "collect"); RadioGroupItem itemType = new RadioGroupItem("type"); itemType.setValueMap("collect", "pay"); itemType.setRedrawOnChange(true); itemType.setValue("collect"); FloatItem itemDiscount = new FloatItem("discount"); itemDiscount.setDecimalPad(2); itemDiscount.setValidateOnExit(true); itemDiscount.setRequired(true); itemDiscount.setReadOnlyWhen(criteriaCollect); itemDiscount.setReadOnlyDisplay(ReadOnlyDisplayAppearance.DISABLED); form.setFields( itemType, itemDiscount ); Window window = new Window(); window.setAutoCenter(true); window.setAutoSize(true); window.addItem(form); window.show();
Code:
Record r = new Record(); r.setAttribute("type", "collect"); form.editRecord(r);
Strange is that when I put this form on page (not in window) it works fine. It doesn't help to wrap form in other layouts and then into window.
So problem is probably connected with Window.
Tested on SmartGWT 12.0p 2019-04-11
Best regards
Mariusz Goch
Comment