I am using smartgwt 4.1 nightly build 4.1-p20150715
After upgrading to this build, i noticed that all SelectItem controls which are using multiselect always fail on form validation for required value. Following is a sample code which I wrote to highlight this failure.
I am able to reproduce this failure on Chrome 43.0.2357.134 (64-bit) and Firefox 34.0.
After upgrading to this build, i noticed that all SelectItem controls which are using multiselect always fail on form validation for required value. Following is a sample code which I wrote to highlight this failure.
I am able to reproduce this failure on Chrome 43.0.2357.134 (64-bit) and Firefox 34.0.
Code:
public void onModuleLoad()
{
final DynamicForm editForm = new DynamicForm();
LinkedHashMap<String,String> valueMap = new LinkedHashMap<String, String>();
valueMap.put("Role1", "role1");
valueMap.put("Role2", "role2");
valueMap.put("Role3", "role3");
SelectItem selectEditItem = new SelectItem();
selectEditItem.setTitle("Test");
selectEditItem.setWidth(170);
selectEditItem.setValueMap(valueMap);
selectEditItem.setRequired(true);
selectEditItem.setWrapTitle(false);
selectEditItem.setMultiple(true);
selectEditItem.setValue( "Role1" ); // default selection
editForm.setFields(selectEditItem);
IButton fetchButton = new IButton("Fetch");
fetchButton.setAlign(Alignment.CENTER);
fetchButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler()
{
@Override
public void onClick(ClickEvent event) {
if( editForm.validate() == false )
{
return;
}
SC.say("Success");
}
});
VLayout testLayout = new VLayout();
testLayout.setMembersMargin(10);
testLayout.addMembers(editForm, fetchButton );
RootLayoutPanel.get().add(testLayout);
}