Hello there,
I am using SmartClient Version: v10.0p_2015-05-08/PowerEdition Deployment (built 2015-05-08) with FF26.
I am displaying a listgrid and a Dynamic form in a VLayout. In the DynamicForm the user will enter/choose some data and save. The listgrid displays the records saved in the form.
The problem I have is in the DynamicForm some of the data(GTINA,GTINB see code below) are read only and need not be saved to the DB. But now it is saving to the db table. How can tell SmartClient not to save those fields to the db.
In the listgrid I am able to not show those two fields by NOT defining the ListGridField for those fields. But in the DynamicForm I need to display them but not save it to the db.
Datasource file
I am using SmartClient Version: v10.0p_2015-05-08/PowerEdition Deployment (built 2015-05-08) with FF26.
I am displaying a listgrid and a Dynamic form in a VLayout. In the DynamicForm the user will enter/choose some data and save. The listgrid displays the records saved in the form.
The problem I have is in the DynamicForm some of the data(GTINA,GTINB see code below) are read only and need not be saved to the DB. But now it is saving to the db table. How can tell SmartClient not to save those fields to the db.
In the listgrid I am able to not show those two fields by NOT defining the ListGridField for those fields. But in the DynamicForm I need to display them but not save it to the db.
Code:
final DataSource ds3 = DataSource.get("productDS"); final SelectItem product = new SelectItem("idp"); product.setOptionDataSource(ds3); product.setDisplayField("name"); final TextItem GTINA = new TextItem("upck"); GTINA.setCanEdit(false); final TextItem GTINB = new TextItem("puck"); GTINB.setCanEdit(false); TextItem batchNo = new TextItem("thc"); product.addChangedHandler(new ChangedHandler() { @Override public void onChanged(ChangedEvent event) { Integer productID = (Integer) product.getValue(); Criteria criteria = new Criteria(); criteria.addCriteria("id", productID); ds3.fetchData(criteria, new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { Record[] records = response.getData(); for (Record record : records) { GTINA.setValue(record.getAttribute("supck")); GTINB.setValue(record.getAttribute("mupck")); } } }); } }); orderForm.setItems(dosageForm, product, GTINA, GTINB, batchNo, mfgDate, expDate, distributor);
Code:
<DataSource ID="newOrderDS" serverType="sql" tableName="rde"> <fields> <field name="id" type="sequence" hidden="true" primaryKey="true" /> <field name="dfid" title="Dosage Form" type="integer" foreignKey="dosformDS.id" joinType="outer" displayField = "dosageformName" required="true"> </field> <field name="dosageformName" includeFrom="dosformDS.name" hidden="true" /> <field name="idp" title="Product" type="integer" foreignKey="productDS.id" joinType="outer" displayField = "productName" required="true"> </field> <field name="productName" includeFrom="productDS.name" hidden="true" /> <field name="upck" title="GTIN A Order Quantity" type="integer"/> <field name="puck" title="GTIN B Order Quantity" type="integer"/> <field name="thc" title="Batch Number" type="text" required="true"/> <field name="date1" title="Manufacturing Date" type="date" required="true"/> <field name="date2" title="Expiry Date" type="date" required="true"/> <field name="dip" title="Distributor" type="integer" foreignKey="distributorDS.id" joinType="outer" displayField = "distributorName" required="false"> </field> <field name="distributorName" includeFrom="distributorDS.name" hidden="true" /> <field name="sden" type="boolean" title="Send"/> <field name="port" type="boolean"/> </fields> </DataSource>
Comment