Hi Isomorphic,
please see this testcase:
To reproduce, please start by clicking the Edit button. When the row appears, select a value from the dropdown in ReportsTo. Then You can see, that the row disappears immediately. When You remove the this line of code,
it works as it should. I was thinking, that clearEditValue only removes the value from the specified ListGridField, in this case "EmployeeId". Can You please clarify if I misunderstand something?
In Case You enter first some value in "EmployeeStatus" it works as expected.
SmartClient Version: v12.0p_2019-01-25/PowerEdition Deployment (built 2019-01-25)
Thanks in Advance,
Kind Regards
please see this testcase:
Code:
package com.smartgwt.sample.client;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.PageKeyHandler;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.events.ChangedEvent;
import com.smartgwt.client.widgets.grid.events.ChangedHandler;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VStack;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class BuiltInDS implements EntryPoint {
private ListGrid boundList;
private IButton editBtn;
/**
* This is the entry point method.
*/
public void onModuleLoad() {
KeyIdentifier debugKey = new KeyIdentifier();
debugKey.setCtrlKey(true);
debugKey.setKeyName("D");
Page.registerKey(debugKey, new PageKeyHandler() {
public void execute(String keyName) {
SC.showConsole();
}
});
VStack vStack = new VStack();
vStack.setLeft(175);
vStack.setTop(75);
vStack.setWidth("70%");
vStack.setMembersMargin(20);
ListGridField reportsTo = new ListGridField("ReportsTo") {
{
final ComboBoxItem cbi = new ComboBoxItem() {
{
setOptionDataSource("employees");
ListGridField iD = new ListGridField("ReportsTo");
setPickListFields(iD);
}
};
setEditorProperties(cbi);
addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
final int row = event.getRowNum();
boundList.clearEditValue(row, "EmployeeId");
}
});
}
};
ListGridField employeeId = new ListGridField("EmployeeId");
ListGridField employeeStatus = new ListGridField("EmployeeStatus");
boundList = new ListGrid();
boundList.setFields(reportsTo, employeeId, employeeStatus);
boundList.setHeight(200);
boundList.setCanEdit(true);
vStack.addMember(boundList);
HLayout hLayout = new HLayout(10);
hLayout.setMembersMargin(10);
hLayout.setHeight(22);
editBtn = new IButton("Edit");
editBtn.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
boundList.startEditingNew();
}
});
hLayout.addMember(editBtn);
vStack.addMember(hLayout);
vStack.draw();
}
}
Code:
boundList.clearEditValue(row, "EmployeeId");
In Case You enter first some value in "EmployeeStatus" it works as expected.
SmartClient Version: v12.0p_2019-01-25/PowerEdition Deployment (built 2019-01-25)
Thanks in Advance,
Kind Regards
Comment