SBTec
SBTec

Reputation: 719

Creation of Forms having widgets in SmartGWT

Thanks guys for your concern as I am tired of by the pathetic support of SmartGWT, however I am pleased to be here as I have got a very positive response here.

My requirement is to create a form that has widgets/controls like button,comboBox and textField on it horizontally but i am getting them vertically. Suggest how can i achieve them vertically.

If i add a HStack on DynamicForm then some of the widgets like comboBox and textBox are not compatible in that situation. Where is the issue lies ?

Upvotes: 1

Views: 1542

Answers (3)

Yuri Gridin
Yuri Gridin

Reputation: 469

To have a form with 3 fields horizontally use form.setNumCols(n+1) :

Example:

    form.setNumCols(4);
    form.setFields(selectItem, new SpacerItem(), miniDateRangeItem);

Upvotes: 0

Alain BUFERNE
Alain BUFERNE

Reputation: 2079

A dynamicform is a sort of grid, by defaul with two columns but you can change this number, every widget is normally filling two cell, one for its title and one for the imput element itself, you can display the title or not, you can change the title oriention (so put it over the input element in place of to the left) etc... you can span a widget on any number of column by using setColspan also. You can make "holes" in your input widget grid by using spacerItem or even complet row with rowspacerItem. Many components, many many attributes, many many many work

Upvotes: 1

Jean-Michel Garcia
Jean-Michel Garcia

Reputation: 2389

You should read the SmartGWT Quick Start Guide.

Smart GWT DataSource objects provide a presentation-independent, implementation-independent description of a set of persistent data fields. DataSources enable you to:

  • Share your data models across multiple applications and components, and across both client and server.
  • Display and manipulate persistent data and data-model relationships (such as parent-child) through visual components (such as TreeGrid).
  • Execute standardized data operations (fetch, sort, add, update, remove) with built-in support on both client and server for data typing, validators, paging, unique keys, and more.
  • Leverage automatic behaviors including data loading, caching, filtering, sorting, paging, and validation.

A DataSource descriptor provides the attributes of a set of DataSource fields. DataSource descriptors can be specified in XML format or created in Java code. The XML format is interpreted and shared by both client and server, while DataSources created in Java are used by the client only.

To be more precise, this line is binding a DataSource object to a Grid

Upvotes: 0

Related Questions