Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FormItem focus issues on iPad

    We have an IntegerItem field with picker icons to increment and decrement the value in the field. When the picker icons are clicked, it calls setValue() on the field to increment/decrement the value. This works great when used in a web browser. However, when we do this on the iPad, the IntegerItem receives focus, and the keyboard bounces up, then usually back down. Sometimes it stays up. The keyboard bouncing up and down is a real usability problem. I've tried calling blurItem() immediately after setValue(), but that just makes it bounce faster.

    Is there a way to prevent the IntegerItem from receiving focus when setValue() is called so the keyboad won't appear?

    Here is a test case you can see the behavior with.

    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.PickerIcon;
    import com.smartgwt.client.widgets.form.fields.SpacerItem;
    import com.smartgwt.client.widgets.form.fields.TextItem;
    import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler;
    import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class CustomDS implements EntryPoint {
    
    	/**
    	 * This is the entry point method.
    	 */
    	@Override
    	public void onModuleLoad() {
    
    		final DynamicForm form = new DynamicForm();
    		form.setMargin(10);
    		form.setAutoFocus(true);
    		form.setWidth(400);
    		form.setTitleWidth(100);
    
    		SpacerItem spacer = new SpacerItem();
    		spacer.setHeight(300);
    
    		final TextItem pickerControls = new TextItem("pickerControls",
    				"Picker Controls");
    
    		PickerIcon clearPicker = new PickerIcon(PickerIcon.CLEAR,
    				new FormItemClickHandler() {
    					int count = 0;
    
    					@Override
    					public void onFormItemClick(FormItemIconClickEvent event) {
    						pickerControls.setValue(count++);
    						// blurItem() helps, but is still jumpy
    						// pickerControls.blurItem();
    					}
    				});
    
    		PickerIcon searchPicker = new PickerIcon(PickerIcon.SEARCH,
    				new FormItemClickHandler() {
    					@Override
    					public void onFormItemClick(FormItemIconClickEvent event) {
    						SC.say("Search Picker clicked");
    					}
    				});
    
    		PickerIcon datePicker = new PickerIcon(PickerIcon.DATE,
    				new FormItemClickHandler() {
    					@Override
    					public void onFormItemClick(FormItemIconClickEvent event) {
    						SC.say("Date Picker clicked");
    					}
    				});
    		PickerIcon refreshPicker = new PickerIcon(PickerIcon.REFRESH,
    				new FormItemClickHandler() {
    					@Override
    					public void onFormItemClick(FormItemIconClickEvent event) {
    						SC.say("Refresh Picker clicked");
    					}
    				});
    
    		pickerControls.setIcons(clearPicker, searchPicker, refreshPicker);
    
    		TextItem datePickerControl = new TextItem("datePicker", "Date Picker");
    		datePickerControl.setIcons(datePicker);
    
    		TextItem refreshOnlyControl = new TextItem("refreshPicker",
    				"Refresh Picker");
    		refreshOnlyControl.setIcons(refreshPicker);
    
    		form.setFields(spacer, pickerControls, datePickerControl,
    				refreshOnlyControl);
    
    		form.draw();
    
    	}
    
    }
    We are running SmartClient Version: v9.1p_2014-07-02/Enterprise Deployment (built 2014-07-02)
    on IOS 7.1.1.
Working...
X