So I am using SmartGWT 4.0 inside the latest version of Chrome.
I am trying to build a simple set of 4 side by side TextBoxes to act as an IP address input area (one field for each octet). So each Textbox is actually a HLayout containing a DynamicForm and a DataSourceIntegerField. The issue I am running into is that I have tried about 100 different ways to get the textboxes to a width of about 30 pixels but cannot get there. No matter what I do, I get 4 evenly spacing fields at about 100+ pixels. This value never changes despite my best effort and hours of hair pulling. Here is the constructor code for a single entry (they are call this same class.)
Am I missing something basic? BTW, IPOctetTextBox extends HLayout.
I am trying to build a simple set of 4 side by side TextBoxes to act as an IP address input area (one field for each octet). So each Textbox is actually a HLayout containing a DynamicForm and a DataSourceIntegerField. The issue I am running into is that I have tried about 100 different ways to get the textboxes to a width of about 30 pixels but cannot get there. No matter what I do, I get 4 evenly spacing fields at about 100+ pixels. This value never changes despite my best effort and hours of hair pulling. Here is the constructor code for a single entry (they are call this same class.)
Code:
public IPOctetTextBox() { super(); DataSource dataSource = new DataSource(); IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator(); integerRangeValidator.setMin(0); integerRangeValidator.setMax(255); dsIntegerField = new DataSourceIntegerField ("intField", "", 3); dsIntegerField.setValidators(integerRangeValidator); dsIntegerField.setLength(3); dsIntegerField.setTitle(""); dataSource.setFields (dsIntegerField); form = new DynamicForm(); form.setNumCols(1); form.setTitleSuffix(""); form.setColWidths(20); form.setTitleWidth(1); form.setWidth100(); form.setOverflow(Overflow.VISIBLE); form.setDataSource (dataSource); FormItem[] fields = form.getFields(); for (int i = 0; i < fields.length; i++) { FormItem formItem = fields[i]; formItem.setWidth(null); } setWidth (50); addMember (form); draw(); }
Comment