In a tabset, the styling of the setShowPending(true) fields is not working correctly for fields shown in tabs not immediately visible. Please look at this:
The second field is not being styled, although the button "set value" sets the values for both.
My code:
The datasource is a very simple sql datasource. Pasted for completeness:
Using smartgwt 6.1p power 04.06.18. This is happening both in chrome 67.0.3396.62 (Offizieller Build) (64-Bit) and in firefox 60.0.1 (64-Bit)
Edit: If I first click on tab 2, then on tab 1, then on the button, it works. It seems to not work when the tab is not drawn.
The second field is not being styled, although the button "set value" sets the values for both.
My code:
Code:
public void onModuleLoad() { final VLayout vlayout = new VLayout(); ValuesManager vm = new ValuesManager(); vm.setDataSource(DataSource.get("schueler")); DynamicForm firstDf = new DynamicForm(); TextItem firstItem = new TextItem("f_vorname", "First name"); firstItem.setShowPending(true); firstDf.setFields(firstItem); firstDf.setValuesManager(vm); DynamicForm secondDf = new DynamicForm(); DateItem secondItem = new DateItem("f_geb_datum", "Geb Datum"); secondItem.setUseTextField(true); secondItem.setUseMask(true); secondItem.setEnforceDate(true); secondItem.setShowPending(true); secondDf.setFields(secondItem); secondDf.setValuesManager(vm); IButton saveButton = new IButton("Save"); saveButton.addClickHandler(event -> vm.saveData()); Criteria c = new Criteria(); c.addCriteria("f_schueler_id", 10788); vm.fetchData(c); IButton setValueButton = new IButton("Set value"); setValueButton.addClickHandler(event -> { firstDf.getField("f_vorname").setValue("abc"); secondDf.getField("f_geb_datum").setValue(new Date()); }); TabSet myTabSet = new TabSet(); Tab firstTab = new Tab("1"); firstTab.setPane(firstDf); myTabSet.addTab(firstTab); Tab secondTab = new Tab("2"); secondTab.setPane(secondDf); myTabSet.addTab(secondTab); vlayout.addMembers(myTabSet, setValueButton, saveButton); vlayout.setWidth100(); vlayout.setHeight100(); vlayout.draw(); }
Code:
<DataSource ID="schueler" serverType="sql" tableName="t_schueler"> <fields> <field name="f_schueler_id" primaryKey="true" type="integer" /> <field name="f_vorname" type="text" /> <field name="f_name" type="text" /> <field name="f_geb_datum" type="text" /> </fields> </DataSource>
Edit: If I first click on tab 2, then on tab 1, then on the button, it works. It seems to not work when the tab is not drawn.
Comment