I'm using: SmartClient Version: SNAPSHOT_v12.1d_2019-11-02/PowerEdition Deployment (built 2019-11-02) and the latest documentation: https://www.smartclient.com/smartgwtee-release/javadoc/
In the documentation for Canvas.getDataPath() there are three example blocks of code. The last one entitled "dataPaths from multiple nested components may also be combined" exemplifies a bug I've been tearing my hair out over. form3 should combine the dataPath from the innerlayout so that it's companyNameField1 StaticTextItem displays the companyName for the parentCompany, "Some Corperation". Instead, it is displaying the companyName of the root map, "Some Company". Evaluating the JS Expression "isc_DynamicForm_1.getFullDataPath()" yeilds "/". Based on the documentation, I would expect it to be "parentCompany/companyName".
I need this to complete a fairly complicated and multiply nested UI that has been designed to use the ValuesManager and dataPaths. If this has been solved in a later version, I couldn't find a post.
Here is the code for quick reference.
In the documentation for Canvas.getDataPath() there are three example blocks of code. The last one entitled "dataPaths from multiple nested components may also be combined" exemplifies a bug I've been tearing my hair out over. form3 should combine the dataPath from the innerlayout so that it's companyNameField1 StaticTextItem displays the companyName for the parentCompany, "Some Corperation". Instead, it is displaying the companyName of the root map, "Some Company". Evaluating the JS Expression "isc_DynamicForm_1.getFullDataPath()" yeilds "/". Based on the documentation, I would expect it to be "parentCompany/companyName".
I need this to complete a fairly complicated and multiply nested UI that has been designed to use the ValuesManager and dataPaths. If this has been solved in a later version, I couldn't find a post.
Here is the code for quick reference.
Code:
ValuesManager vm = new ValuesManager(); Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap); Map values1 = new HashMap(); values1.put("companyName", "Some Corporation"); Map addressMap1 = new HashMap(); addressMap1.put("street", "1 High Street"); addressMap1.put("city", "New York"); addressMap1.put("state", "NY"); values1.put("address", addressMap1); values.put("parentCompany", values1); vm.setValues(values); Layout layout = new Layout(); layout.setValuesManager(vm); DynamicForm form = new DynamicForm(); form.setDataPath("/"); TextItem companyNameField = new TextItem("companyName"); form.setItems(companyNameField); DynamicForm form1 = new DynamicForm(); form1.setDataPath("address"); TextItem streetField = new TextItem("street"); TextItem cityField = new TextItem("city"); TextItem stateField = new TextItem("state"); form1.setItems(streetField, cityField, stateField); Layout innerlayout = new Layout(); innerlayout.setBorder("2px solid blue"); // debug innerlayout.setDataPath("parentCompany"); DynamicForm form3 = new DynamicForm(); form3.setDataPath("/"); StaticTextItem companyNameField1 = new StaticTextItem("companyName"); form3.setItems(companyNameField1); DetailViewer detailViewer = new DetailViewer(); detailViewer.setDataPath("address"); DetailViewerField streetDVField = new DetailViewerField("street"); DetailViewerField cityDVField = new DetailViewerField("city"); DetailViewerField stateDVField = new DetailViewerField("state"); detailViewer.setFields(streetDVField, cityDVField, stateDVField); innerlayout.addMember(form3); innerlayout.addMember(detailViewer); layout.addMember(form); layout.addMember(form1); layout.addMember(innerlayout);
Comment