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.
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.
Code:
LinkItem.setShowIfCondition(new FormItemIfFunction() { public boolean execute(FormItem item, Object value, DynamicForm form) { if (value.toString().equals("-")) return false; else return true; } });
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.
Comment