psi_mmobile

Untitled

Jul 1st, 2025
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /**
  2. * Handle readonly mode for forms
  3. * @param form the form we're managing
  4. * @param readOnlyReference which readonly value we're using
  5. * @param componentIdList list of ids that are handled differently than readonly
  6. */
  7.  
  8. static handleReadOnlyForm(form, readOnlyReference : boolean, componentIdList : Array<String>) {
  9. if (readOnlyReference) {
  10. form.eachWidget((widget) => {
  11. if (widget.type === 'threestatecheckbox') {
  12. widget.checkbox.readOnly = readOnlyReference;
  13. }
  14. componentIdList.forEach(value => {
  15. if (widget.id === value) {
  16. widget.hidden = readOnlyReference;
  17. }
  18. })
  19. widget.readOnly = readOnlyReference;
  20. })
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment