Announcement

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

  • Blama
    replied
    Hi Isomorphic,

    please see this Testcase using Simplicity skin:
    BuiltInDS.java:
    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.data.Criteria;
    import com.smartgwt.client.data.DSCallback;
    import com.smartgwt.client.data.DSRequest;
    import com.smartgwt.client.data.DSResponse;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.types.ReadOnlyDisplayAppearance;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
    import com.smartgwt.client.widgets.form.fields.SelectItem;
    import com.smartgwt.client.widgets.form.fields.SpinnerItem;
    import com.smartgwt.client.widgets.form.fields.StaticTextItem;
    import com.smartgwt.client.widgets.form.fields.TextAreaItem;
    import com.smartgwt.client.widgets.form.fields.TextItem;
    import com.smartgwt.client.widgets.layout.HStack;
    
    public class BuiltInDS implements EntryPoint {
    
    	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();
    			}
    		});
    
    		HStack stack = new HStack();
    		stack.setLeft(20);
    		stack.setTop(20);
    		stack.setWidth100();
    		stack.setMembersMargin(20);
    
    		Testform enabledForm = new Testform("ENABLED");
    
    		Testform roroForm = new Testform("Readonly-Readonly");
    		roroForm.setReadOnlyDisplay(ReadOnlyDisplayAppearance.READONLY);
    		roroForm.setCanEdit(false);
    
    		Testform rodiForm = new Testform("Readonly-Disabled");
    		rodiForm.setReadOnlyDisplay(ReadOnlyDisplayAppearance.DISABLED);
    		rodiForm.setCanEdit(false);
    
    		Testform rostForm = new Testform("Readonly-Static");
    		rostForm.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);
    		rostForm.setCanEdit(false);
    
    		Testform disabledForm = new Testform("DISABLED");
    		disabledForm.setDisabled(true);
    		stack.addMembers(enabledForm, roroForm, rodiForm, rostForm, disabledForm);
    		stack.draw();
    	}
    
    	private class Testform extends DynamicForm {
    		private StaticTextItem typeField;
    		private TextItem scientificName;
    		private TextItem commonName;
    		private SelectItem status;
    		private ComboBoxItem status2;
    		private SpinnerItem lifeSpan;
    		private TextAreaItem information;
    
    		public Testform(final String type) {
    			super();
    			setWidth(200);
    			setDataSource(DataSource.get("animals"));
    			typeField = new StaticTextItem("TYPE");
    
    			commonName = new TextItem("commonName");
    			scientificName = new TextItem("scientificName");
    			status = new SelectItem("status", "Status(SI)");
    			status2 = new ComboBoxItem("status", "Status(CBI)");
    			lifeSpan = new SpinnerItem("lifeSpan");
    			information = new TextAreaItem("information");
    			information.setHeight(100);
    			setFields(typeField, commonName, scientificName, status, status2, lifeSpan, information);
    			fetchData(new Criteria("scientificName", "Loxodonta africana"), new DSCallback() {
    				@Override
    				public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
    					typeField.setValue(type);
    				}
    			});
    		}
    	}
    }
    I attached a sceenshot (Missing_visual_cues_and_other_problems.jpg). To answer your question 1:
    • See (1) in the screenshot. I can't tell apart the TextItems and TextAreaItems in enabled and setCanEdit(false)+ReadOnlyDisplayAppearance.READONLY. Also for the other items it is not that intuitive/easy to see.
    • See (2) in the screenshot. I can't use setDisabled(true) or setCanEdit(false)+ReadOnlyDisplayAppearance.DISABLED, because of the unusable native scrollbars. I get valid user complaints.
    • See (3) in the screenshot. Minor unrelated bug.


    To answer your question 2:
    • I can't c&p in setDisabled(true) or setCanEdit(false)+ReadOnlyDisplayAppearance.DISABLED (correct behaviour per docs)
    • I can't scroll in setDisabled(true) or setCanEdit(false)+ReadOnlyDisplayAppearance.DISABLED (see linked thread above)
    IMHO the best would be:
    • c&p and scrolling from setCanEdit(false)+ReadOnlyDisplayAppearance.READONLY
    • Gray font for both data and label from setDisabled(true) or setCanEdit(false)+ReadOnlyDisplayAppearance.DISABLED

    This mode would have the best from both worlds and the other two modes would not be needed then, anymore IMHO. Again, "disabled" is unusable because of the TextAreaItem problem.
    I'd see ReadOnlyDisplayAppearance.STATIC as more of a print-preview mode. It hides the nature of the data (free entry or dropdown).


    To answer your question 3:
    You had a checkbox "start disabled" in the marked location in the 2nd screenshot, which affected all samples.

    Best regards
    Blama
    Attached Files

    Leave a comment:


  • Isomorphic
    replied
    This is way too vague to answer at the moment.

    1. in what skin and for what specific formItem are you seeing a lack of visual cues that the item is disabled? How can this be reproduced?

    2. on what formItem type were you having difficulty with copy and paste, and were you expecting scrolling?

    3. what "start as disabled" mode are you talking about? Does this refer to some specific sample?

    Leave a comment:


  • ReadOnlyDisplayAppearance behaviour: Best mode missing (disabled + c&p + scrolling)

    Hi Isomorphic,

    IMHO the best mode for read-only FormItems is missing from the configuration options:
    • Default-ReadOnlyDisplayAppearance.READONLY is missing visual pointers to the read-only nature of the items
    • ReadOnlyDisplayAppearance.DISABLED also disables copy&paste (and perhaps scrolling)
    • ReadOnlyDisplayAppearance.STATIC takes away information about the nature of an item (e.g.: free-entry or dropdown? text or "real" date?) and gives an "unknown" UI to a user who also knows the readWrite-version of the form.

    A setting of ReadOnlyDisplayAppearance.DISABLED plus copy and paste and easy scrolling via mousewheel and scrollbars would be the best behaviour for me. I'd say it is not possible to use anything else than ReadOnlyDisplayAppearance.DISABLED currently for the reasons given. But then the no-copy&paste is annoying and the no-scrolling (which might be a bug) is perceived as UI defect (happened to me).

    I'm using current 5.0p/5.1d.

    Best regards
    Blama

    PS: You removed the "start as disabled"-mode from the online showcase. I'm sure you have reasons for this, but it would make testing easier.
Working...
X