[SmartClient Version: v11.0p_2016-09-09/PowerEdition Deployment (built 2016-09-09) and also SmartClient Version: v11.0p_2016-09-28/PowerEdition Deployment (built 2016-09-28)]
Some of our code has stopped working when we recently updated from SmartGWT 5.1 to 6.0. The cause seems to be a change in FormItem, although the problem can only be observed when FormItems are created within SearchForms.
Prior to v6.0, the FormItem constructor looked like this:
...and now in v6.0 it looks like this:
What I am questioning here is the editorType attribute being explicitly set to FormItem. If I modify the Component XML in the Hello World (http://www.smartclient.com/#helloWorld)example to the following, you will see that the item in question is rendered as static text rather than as an editable item (in this case I would expect a TextItem).
Now, if we change from containing our field within a SearchForm to a DynamicForm and try again the item renders correctly as a TextItem.. It also works if we keep the top-level container as a SearchForm but remove the editorType attribute.
Similarly, if I modify our code to create a TextItem then the search field renders as expected. However, we cannot guarantee that all search fields we will be creating in this SearchForm will be TextItems and we would rather defer to the underlying logic that is already in place in the libraries to render an appropriate edit control based on the underlying type of the field. In other words, we'd rather create Formitem objects and have the SmartClient logic handle rendering of the appropriate controls based on the underlying type of the field definition in the datasource to which the SearchForm is bound.
Regards,
Gary
Some of our code has stopped working when we recently updated from SmartGWT 5.1 to 6.0. The cause seems to be a change in FormItem, although the problem can only be observed when FormItems are created within SearchForms.
Prior to v6.0, the FormItem constructor looked like this:
Code:
public FormItem(String name) { setName(name); }
Code:
public FormItem(String name) { setName(name); setAttribute("editorType", "FormItem"); linkToInstanceUponCreate(); }
Code:
<SearchForm autoFocus="true" numCols="3" ><items> <FormItem editorType="FormItem" type="text" name="you" title="Enter your name" selectOnFocus="true" wrapTitle="false" defaultValue="my friend" /> </items></SearchForm>
Similarly, if I modify our code to create a TextItem then the search field renders as expected. However, we cannot guarantee that all search fields we will be creating in this SearchForm will be TextItems and we would rather defer to the underlying logic that is already in place in the libraries to render an appropriate edit control based on the underlying type of the field. In other words, we'd rather create Formitem objects and have the SmartClient logic handle rendering of the appropriate controls based on the underlying type of the field definition in the datasource to which the SearchForm is bound.
Regards,
Gary
Comment