Announcement

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

  • levi
    replied
    Thanks,
    integrated with the 25-05-2011 build and this works like a charm!

    Leave a comment:


  • Isomorphic
    replied
    We've gone ahead and added a new attribute formatOnFocusChange to TextItem to handle this case - please give it a try and let us know if it works for you and if it meets your needs.

    It'll be present in the next nightly build.

    Thanks
    Isomorphic Software

    Leave a comment:


  • Isomorphic
    replied
    Which items do you need this on? TextItem only?

    Leave a comment:


  • Isomorphic
    replied
    The formatter is not going to be invoked unless the value has logically changed. We'll look at what it would take to add a flag saying the formatter should be invoked on focus/blur.

    Leave a comment:


  • levi
    replied
    No, not a hint, but
    the item shows value "3 kilo" or "twenty banana crates" as value (output from FormItemValueFormatter.formatValue) until the item receives focus, at that point (and not when the user is typing) it should change into "3" or "twenty crates" or whatever value. The FormItemValueFormatter.formatValue can handle this, but it doesn't seem to be called when the item receives focus.

    Is there something better to get this behavior?
    thanks,

    Leave a comment:


  • Isomorphic
    replied
    What different value? If you're trying to implement a hint that vanishes when the field gets focus, use showHintInField.

    Leave a comment:


  • hin3x
    started a topic EditorValueFormatter and focus behavior

    EditorValueFormatter and focus behavior

    Hi guys!

    I have a FormItem on a DynamicForm and I've set it with the following editorType:
    Code:
    public class CustomEditorType extends TextItem {
    
    	public CustomEditorType() {
    		super();
    		this.setEditorValueFormatter(new FormItemValueFormatter() {
    			
    			public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
    				boolean hasFocusInOurApp = item.getShowIcons();
    				
    				if (hasFocusInOurApp) {
    					return "1";
    				} else {
    					return "2";
    				}
    			}
    		});
    	}
    }
    I would like to show a different value to the user when the formitem has the focus.
    The problem is that this value formatter is only called on a redraw.
    How can this case be solved without a redraw?

    Thank you in advance for any help you can provide.
Working...
X