Announcement

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

    How to hide/show LinkItem

    I have a LinkItem on a DynamicForm. The value is set programmatically and I want the LinkItem to appear when there is a value set and not when there is none. I've tried the following code (with variations checking for value==null and value.toString().isEmpty), but it results in an error that causes the canvas not to be drawn at all. However, no error shows up in the dev console.
    Code:
    LinkItem.setShowIfCondition(new FormItemIfFunction() {
    	public boolean execute(FormItem item, Object value,
    			DynamicForm form) {
    		if (value.toString().equals("-"))
    			return false;
    		else return true;
    	}
    });
    I've also tried coding LinkItem.hide() and LinkItem.show() but that causes the browser to crash.

    What is the proper way to show/hide a LinkItem on a form. I've tried enable/disable and that works, but does not have the desired effect. You still see the LinkItem, just with the title grayed out.
    Last edited by jay.l.fisher; 3 Jan 2010, 08:13.

    #2
    Nevermind. LinkItem.show() and hide() do what one would expect. I was calling hide() before the canvas on which the form sits was drawn and that was causing it to crash.

    Comment

    Working...
    X