Hi,
I have two databound objects - ListGrid and DynamicForm. What I want to do is to be able to have different fields on those two objects as well as add additional ones.
For example, if you consider a typical user account table with the following fields:
id {pk}
username
password
lastlogin
status
privilege
When I data bind the source to ListGrid and DynamicForm, I get all of the above fields displayed except id (which is .setHidden(true)). But I do want it arranged as follows:
ListGrid:
username
lastlogin
status
privilege
DynamicForm:
username
password
confirmpassword (non-db)
lastlogin
status
privilege
I don't understand how I can pick and mix which fields to display in a databound object. I tried .setFields option but that seems to only be for non-databound fields.
I have also tried the following:
This kind of worked, however, when I tried to do form.saveData(), I got an error message saying that .saveData() is not support for non-databound DynamicForm.
Any ideas?
P.S. I am quite new in Java/GWT, so be gentle :)
I have two databound objects - ListGrid and DynamicForm. What I want to do is to be able to have different fields on those two objects as well as add additional ones.
For example, if you consider a typical user account table with the following fields:
id {pk}
username
password
lastlogin
status
privilege
When I data bind the source to ListGrid and DynamicForm, I get all of the above fields displayed except id (which is .setHidden(true)). But I do want it arranged as follows:
ListGrid:
username
lastlogin
status
privilege
DynamicForm:
username
password
confirmpassword (non-db)
lastlogin
status
privilege
I don't understand how I can pick and mix which fields to display in a databound object. I tried .setFields option but that seems to only be for non-databound fields.
I have also tried the following:
Code:
final DataSource userDataSource = new VDataSource("app/user/"); DataSourceField uField = new DataSourceField("username", FieldType.TEXT,"Username"); userDataSource.addField(uField); TextItem uTextField = new TextItem(); uTextField.setTitle("Username"); uTextField.setDisplayField("username"); final DynamicForm form = new DynamicForm(); //form.setDataSource(userDataSource); form.setFields(uTextField);
Any ideas?
P.S. I am quite new in Java/GWT, so be gentle :)
Comment