Hi all.. I'm following the example code in the form_splitting demo (http://www.smartclient.com/smartgwt/showcase/#layout_form_splitting) but when the code runs it complains with a number of errors like the following -- one for each form field -- there are two other complains about id collisions and those fields are not editable.. Any ideas?
I've checked the code and no-reuse is being done.. Below is the code in question :
Below is the ds.xml file for the Organization items:
Code:
[INFO] [myapp] - init Organization_Edit()... [ERROR] [myapp] - 12:23:32.965:MUP2:WARN:DynamicForm:form0:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [ERROR] [myapp] - 12:23:32.967:MUP2:WARN:DynamicForm:form0:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [ERROR] [myapp] - 12:23:32.969:MUP2:WARN:DynamicForm:form0:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [ERROR] [myapp] - 12:23:32.971:MUP2:WARN:DynamicForm:form0:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [ERROR] [myapp] - 12:23:32.974:MUP2:WARN:DynamicForm:form0:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [ERROR] [myapp] - 12:23:32.976:MUP2:WARN:DynamicForm:form0:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [ERROR] [myapp] - 12:23:32.997:MUP2:WARN:Log:ClassFactory.addGlobalID: ID:'isc_TextItem_6' for object '[TextItem ID:isc_TextItem_6 name:adminName]' collides with ID of existing object '[TextItem ID:isc_TextItem_6 name:address]'. The global reference to this object will be replaced [ERROR] [myapp] - 12:23:32.998:MUP2:WARN:Log:ClassFactory.addGlobalID: ID:'isc_TextItem_5' for object '[TextItem ID:isc_TextItem_5 name:adminPhone]' collides with ID of existing object '[TextItem ID:isc_TextItem_5 name:organizationName]'. The global reference to this object will be replaced [ERROR] [myapp] - 12:23:33.000:MUP2:WARN:DynamicForm:form1:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [ERROR] [myapp] - 12:23:33.002:MUP2:WARN:DynamicForm:form1:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [ERROR] [myapp] - 12:23:33.004:MUP2:WARN:DynamicForm:form1:destroyed FormItem passed to setItems()/addItem(): FormItems cannot be re-used with different DynamicForms [INFO] [myapp] - Organization_Edit.Factory.create()->view.getID() - isc_Organization_Edit_0
Code:
public Organization_Edit() { super(); GWT.log("init Organization_Edit()...", null); // Initialize the Accounts View layout container this.setStyleName("ContextArea"); this.setWidth("*"); DataSource OrganizationDS = DataSource.get("Organization"); final ValuesManager vm = new ValuesManager(); vm.setDataSource(OrganizationDS); final TabSet theTabs = new TabSet(); theTabs.setWidth(500); theTabs.setHeight(250); //////////////////////////////////////////////////////////////////////////// // Define the first tab content //////////////////////////////////////////////////////////////////////////// Tab organizationTab = new Tab(); organizationTab.setTitle("Organization Info"); final DynamicForm Orgform = new DynamicForm(); Orgform.setID("form0"); Orgform.setValuesManager(vm); TextItem OrganizationItem = new TextItem(); OrganizationItem.setName("organizationName"); TextItem addressItem = new TextItem(); addressItem.setName("address"); TextItem cityItem = new TextItem(); cityItem.setName("city"); ComboBoxItem stateItem = new ComboBoxItem(); stateItem.setName("state"); stateItem.setType("comboBox"); TextItem zipItem = new TextItem(); zipItem.setName("zipcode"); TextItem organizationPhoneItem = new TextItem(); organizationPhoneItem.setName("organizationPhone"); Orgform.setFields( OrganizationItem, addressItem, cityItem, stateItem, zipItem, organizationPhoneItem ); organizationTab.setPane(Orgform); //////////////////////////////////////////////////////////////////////////// // Define the second tab content //////////////////////////////////////////////////////////////////////////// Tab adminTab = new Tab(); adminTab.setTitle("Admin's Information"); final DynamicForm Adminform = new DynamicForm(); Adminform.setID("form1"); Adminform.setValuesManager(vm); TextItem adminName = new TextItem(); adminName.setName("adminName"); TextItem adminPhone = new TextItem(); adminPhone.setName("adminPhone"); TextItem adminEmail = new TextItem(); adminEmail.setName("adminEmail"); Adminform.setFields( adminName, adminPhone, adminEmail ); adminTab.setPane(Adminform); theTabs.setTabs(organizationTab, adminTab); IButton saveButton = new IButton("Save"); saveButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (vm.validate()) { // Save the new form data if validation passed vm.saveData(); } else // If errors, select the proper tab { if (Adminform.hasErrors()) { theTabs.selectTab(1); } else { theTabs.selectTab(0); } } } }); HStack buttons = new HStack(10); buttons.setHeight(24); buttons.setMembers(saveButton); VLayout layout = new VLayout(10); layout.setMembers(theTabs, buttons); this.addMember(layout); }
Code:
<DataSource ID="Organization" serverType="sql" tableName="Organization" testFileName="/ds/test_data/Organization.data.xml" > <fields> <field name="organizationId" title="Organization ID" type="sequence" primaryKey="true" hidden="true" /> <field name="organizationName" title="Organization Name" required="true" type="text" length="64"/> <field name="address" title="Address" required="true" type="text" length="64"/> <field name="city" title="City" required="true" type="text" length="32"/> <field name="state" title="State" required="true" type="text" length="2"> <valueMap> <value>AL</value> <value>AK</value> <value>AZ</value> <value>AR</value> <value>CA</value> <value>CO</value> <value>CT</value> <value>DE</value> <value>FL</value> <value>GA</value> <value>GU</value> <value>HI</value> <value>ID</value> <value>IL</value> <value>IN</value> <value>IA</value> <value>KS</value> <value>KY</value> <value>LA</value> <value>ME</value> <value>MD</value> <value>MA</value> <value>MI</value> <value>MN</value> <value>MS</value> <value>MO</value> <value>MT</value> <value>NE</value> <value>NV</value> <value>NH</value> <value>NJ</value> <value>NM</value> <value>NY</value> <value>NC</value> <value>ND</value> <value>OH</value> <value>OK</value> <value>OR</value> <value>PA</value> <value>PR</value> <value>RI</value> <value>SC</value> <value>SD</value> <value>TN</value> <value>TX</value> <value>UT</value> <value>VT</value> <value>VI</value> <value>VA</value> <value>WA</value> <value>WV</value> <value>WI</value> <value>WY</value> </valueMap> </field> <field name="zipcode" title="Zip code" required="true" type="text" length="10"/> <field name="organizationPhone" title="Phone #" required="true" type="text" length="12"/> <field name="adminName" title="Administrators Name" required="true" type="text" length="64"/> <field name="adminPhone" title="Admin's Phone #" required="true" type="text" length="12"/> <field name="adminEmail" title="Admin's Email Address" required="true" type="text" length="48"/> </fields> </DataSource>
Comment