Details
-
New Feature
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
All
-
Sprint to Mid June
-
GreenHopper Ranking:0|i0za2z:
-
9223372036854775807
-
Small
Description
see TDP-3463 for the high level requirements.
We need a widget that display a list of the scheam columns where the columns can be selected and also a preview of data with the selected columns.
We should use the following java model code.
public final Property<List<String>> selectColumnIds = newStringList("selectColumnIds"); //this would hold the selected columns ids public void setupProperties() { super.setupProperties(); //setup possible values selectColumnIds.setPossibleValues(new NamedThing[]{ new NamedThing("col1","Surname"), new NamedThing("col2","Name"), new NamedThing("col3","Phone")); //may setup default selected column like this selectColumnIds.setValue(selectColumnIds.getPossbileValues().get(0)); } public void setupLayout() { super.setupLayout(); Form mainForm = new Form(this, Form.MAIN); Widget tableSelectionWidget = widget(selectColumnIds).setWidgetType(MULTIPLE_VALUE_SELECTOR_WIDGET_TYPE); mainForm.addRow(tableSelectionWidget); }
this would generate something like this in the ui-specs
{ "jsonSchema": { "title": "Main form", "type": "object", "properties": { "selectColumnIds": { "type": "array", "items": { "type": "string", "enum": ["col1", "col2", "col3"], "enumNames": ["Surname","Name","Phone" ] }, "uniqueItems": true }, } }, "uiSchema": { "selectColumnIds": { "ui:widget":"listview" } }, "properties": { "selectColumnIds":["col1"] } }
So from the Component developper this is just a mean to choose some some items from a list.
From the front end this widget shall be calling the runtime tcom endpoint to get the sample data to display on the table. But this should not impact the Component developper.
Things to be done :
1) Add a new widget name in daikon ( https://github.com/Talend/daikon/blob/master/daikon/src/main/java/org/talend/daikon/properties/presentation/Widget.java )
this will be called MULTIPLE_VALUE_SELECTOR_WIDGET_TYPE and should be documented as being backed by a Property<List<String>> for the java model where the possible values are the one displayed in the widget for selection.
2) update daikon ui-specs serialization :
- json-schema generation : check that the java model Property<List<String>> generates the proper json-schema as seen above, that is a object of type "array" with the enums and enumNames.
( https://github.com/Talend/daikon/blob/master/daikon/src/main/java/org/talend/daikon/serialize/jsonschema/JsonSchemaGenerator.java ) - ui-schema generation : check that the generated widget name matches the front end widget name : listview
( https://github.com/Talend/daikon/blob/master/daikon/src/main/java/org/talend/daikon/serialize/jsonschema/UiSchemaGenerator.java )
3) Update the Salesforce component to use this model both on the Form definition and the runtime.