Hello,
Don't now if this is desired but when conditions work only with fields available in current DynamicForm and not with whole Record and multiple DynamicForms connected with ValuesManager.
Or maybe there is a switch to enable field to be evaluated in global scope?
See this test case:
When setting status field to finished `field1` item becomes readonly but `field2` does not.
Is there a way to use values from whole Record in this condition? Tried `setRedrawOnChange` but with no luck.
Best regards
Mariusz Goch
Don't now if this is desired but when conditions work only with fields available in current DynamicForm and not with whole Record and multiple DynamicForms connected with ValuesManager.
Or maybe there is a switch to enable field to be evaluated in global scope?
See this test case:
Code:
DataSource ds = new DataSource(); ds.setClientOnly(true); DataSourceIntegerField fieldId = new DataSourceIntegerField("id"); fieldId.setPrimaryKey(true); ds.addField(fieldId); ds.addField(new DataSourceTextField("field1")); ds.addField(new DataSourceTextField("field2")); DataSourceTextField fieldStatus = new DataSourceTextField("status"); fieldStatus.setValueMap("new", "progress", "finished"); ds.addField(fieldStatus); VLayout layout1 = new VLayout(5); layout1.setGroupTitle("vm1"); ValuesManager vm1 = new ValuesManager(); vm1.setDataSource(ds); DynamicForm form1 = new DynamicForm(); form1.setDataSource(ds); form1.setValuesManager(vm1); TextItem itemField1 = new TextItem("field1"); itemField1.setReadOnlyWhen(new AdvancedCriteria("status", OperatorId.IN_SET, new String[] {"finished"})); SelectItem itemStatus = new SelectItem("status"); itemStatus.setRedrawOnChange(true); form1.setFields( new TextItem("id"), itemField1, itemStatus ); layout1.addMember(form1); DynamicForm form2 = new DynamicForm(); form2.setDataSource(ds); form2.setValuesManager(vm1); TextItem itemField2 = new TextItem("field2"); itemField2.setReadOnlyWhen(new AdvancedCriteria("status", OperatorId.IN_SET, new String[] {"finished"})); form2.setFields( itemField2 ); layout1.addMember(form2); this.addChild(layout1);
Is there a way to use values from whole Record in this condition? Tried `setRedrawOnChange` but with no luck.
Best regards
Mariusz Goch
Comment