Hi Isomorphic,
I have a working setup for a ListGrid with 1:N Dropdown assignment of values.
I've been trying that for one long time, so if you could add a simple example to the showcase, I'm sure many users would appreciate it.
ds.xml excerpt:
.java excerpt:
Now my question:
In the Quick Start Guide (p. 65) you strongly suggest to push as much settings as possible to the .ds.xml file, which I like and do.
Is there a possibility (or is it planned) to move the above Java code to the ds.xml file? http://www.smartclient.com/smartgwte...urceField.html does not list these options.
Thank you,
Blama
I have a working setup for a ListGrid with 1:N Dropdown assignment of values.
I've been trying that for one long time, so if you could add a simple example to the showcase, I'm sure many users would appreciate it.
ds.xml excerpt:
Code:
<fields> <field primaryKey="true" hidden="true" name="ID" type="sequence"></field> <field name="ANREDE_ID" title="Anrede" type="int" displayField="ANREDE" required="true"></field> <field name="ANREDE" hidden="true" nativeName="NAME" type="text" tableName="T_ANREDE"></field> .... </fields> <operationBindings> <operationBinding operationType="fetch"> <tableClause>T_PERSON INNER JOIN T_ANREDE ON T_PERSON.ANREDE_ID = T_ANREDE.ID </tableClause> </operationBinding> </operationBindings>
.java excerpt:
Code:
//Field to work with ListGridField anredeIdLGF = boundList.getField("ANREDE_ID"); //DS for translating IDs to Strings DataSource anredeDS = DataSource.get("T_ANREDE"); anredeDS.setCacheAllData(true); //Formitem when in "edit" in the ListGrid after doubleclick //ComboBox so that the user can type. SelectItem would also be possible for short lists ComboBoxItem anredeIdCBI = new ComboBoxItem(); anredeIdCBI.setOptionDataSource(anredeDS); //"Translation" anredeIdCBI.setValueField("ID"); anredeIdCBI.setDisplayField("NAME"); anredeIdLGF.setEditorType(anredeIdCBI); //SelectItem as filter, so that the top entry is empty in order to reset the filter. //If .setEditorType used SelectItem, too, no new object would be needed. SelectItem anredeIdSI = new SelectItem(); anredeIdSI.setOptionDataSource(anredeDS); anredeIdSI.setValueField("ID"); anredeIdSI.setDisplayField("NAME"); anredeIdLGF.setFilterEditorType(anredeIdSI); //Enable filter boundList.setShowFilterEditor(true);
In the Quick Start Guide (p. 65) you strongly suggest to push as much settings as possible to the .ds.xml file, which I like and do.
Is there a possibility (or is it planned) to move the above Java code to the ds.xml file? http://www.smartclient.com/smartgwte...urceField.html does not list these options.
Thank you,
Blama
Comment