When getValuesAsRecord() is called upon a DynamicForm in which CheckboxItems or TextItems have not been altered, the resultant getValuesAsRecord() values map does not include those unaltered items. In the following ...
... when clicking the IButton after none of the FormItems have been focused on, nothing is logged (for loop has zero iterations). When clicking the IButton after a CheckboxItem has been checked (or even checked and then unchecked) or the TextItem has been typed into (or even typed into and then erased), the altered FormItem is then logged (for loop includes that FormItem in its iteration).
This exclusion of unaltered values in the getValuesAsRecord() values map is causing me isssue when I go to do an addData(...) with these values because when they reach the server, the generated SQL INSERT statement does not include the initial values I need to have. And having legacy iSeries DB2 tables, we cannot place default attributes on the table columns.
How can we have getValuesAsRecord() provide the entire values map (for unaltered and altered fields)? Thanks.
SmartClient Version: v8.3p_2013-03-13/PowerEdition Deployment (built 2013-03-13)
Code:
public class MyEntryPoint implements EntryPoint { public void onModuleLoad() { final DynamicForm form = new DynamicForm(); VLayout vlo = new VLayout(); IButton btn = new IButton("Get FormItem"); CheckboxItem cb1 = new CheckboxItem("CB1", "Checkbox 1"); CheckboxItem cb2 = new CheckboxItem("CB2", "Checkbox 2"); TextItem ti1 = new TextItem("TB", "Textbox"); FormItem[] aFi = new FormItem[3]; aFi[0] = cb1; aFi[1] = cb2; aFi[2] = ti1; form.setFields(aFi); vlo.setMembers(btn, form); vlo.setWidth100(); vlo.setHeight100(); btn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { for (String s: form.getValuesAsRecord().getAttributes()) { GWT.log("Attribute=" + s); } } }); vlo.draw(); } }
This exclusion of unaltered values in the getValuesAsRecord() values map is causing me isssue when I go to do an addData(...) with these values because when they reach the server, the generated SQL INSERT statement does not include the initial values I need to have. And having legacy iSeries DB2 tables, we cannot place default attributes on the table columns.
How can we have getValuesAsRecord() provide the entire values map (for unaltered and altered fields)? Thanks.
SmartClient Version: v8.3p_2013-03-13/PowerEdition Deployment (built 2013-03-13)