Announcement

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

    Change all FormItems to StaticTextItems

    I have a complex set of forms using a ValuesManager, split across multiple tabs and layouts with a number of different showIfConditions of various fields. I need to support a "display only" mode where those same forms can be used to display the data without allowing updates.

    I'd like to leave the existing form creation code remain unchanged and for display mode simply change all of the FormItems to type StaticTextItem. I've tried iterating over the Forms and FormItems and calling FormItem.setType("StaticTextItem"). I've also tried iterating over the Forms and setting each FormItem to a new StaticTextItem using the original FormItem's name. Neither of those has any effect.

    Is there a way to reuse these edit forms in a display only mode?

    #2
    We don't currently support switching item type on the fly. Options are to change the form creation code so that it can return StaticTextItems when passed a flag, or have parallel StaticTextItems that are not initially shown and use show()/hide() to make them visible. The former is really the better option.

    Comment

    Working...
    X