arrow_back history picture_as_pdf This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ~~Title: Bind Editors to Tables~~ Editing of data in a database application should be possible directly in a table as well as via forms. Form-based entry increases clarity and allows grouping that is difficult when using tables. The active model of JVx allows the displaying and editing of data in many different ways, regardless of whether the data is a table, a graph, or a text editor. In all cases, the data is governed by the model. Changes in the model affect all registered components. Therefore, the displayed data is always synchronized. == Example == In our application, we want to create a form that allows the viewing and editing of contact details. Data entry should be possible directly in a table or via a form. The following are the definitions of the editors for the form. Details about displaying data tables can be found [[jvx:client:model:data:database|here]]. Definition of the editors: <file java> RemoteDataBook rdbContacts = new RemoteDataBook(); rdbContacts.setDataSource(dataSource); rdbContacts.setName("contacts"); rdbContacts.open(); UIEditor edtFirstName = new UIEditor(); edtFirstName.setDataRow(rdbContacts); edtFirstName.setColumnName("FIRSTNAME"); UIEditor edtLastName = new UIEditor(); edtLastName.setDataRow(rdbContacts); edtLastName.setColumnName("LASTNAME"); UIEditor edtStreet = new UIEditor(); edtStreet.setDataRow(rdbContacts); edtStreet.setColumnName("STREET"); UIEditor editNr = new UIEditor(); editNr.setDataRow(rdbContacts); editNr.setColumnName("NR"); </file> It is sufficient when the column description and the IDataRow are set in an UIEditor. The column´s data type determines which editor is used. In our example, a number editor is used for the NR and a text editor for all other fields. A date editor is used for the date column. The UIEditor can easily be added to the layout/form. For example: <file java> panel.add(editNr); </file> Of course, the characteristics of the layout should be considered!